• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Docker ColdFusion 2023 XX:MaxRAMPercentage Support?

Explorer ,
Jan 03, 2024 Jan 03, 2024

Copy link to clipboard

Copied

Hey,

 

trying to setup CF 2023 / Java 17 to run properly on Kubernetes and while trying to setup jvm.config and setting 

-XX:MaxRAMPercentage=70 -XX:InitialRAMPercentage=70

rather than something like

-Xms1024m -Xmx1024m

as it is much easier to manage regarding the pods memory requests, Service is starting just fine but the "Java and JVM" admin console is broken with error
Element JDKPATH is undefined in FORM. The specific sequence of files included or processed is: /opt/coldfusion/cfusion/wwwroot/CFIDE/administrator/settings/jvm.cfm, line: 227

 

My guess is that console is trying to read -Xms and -Xmx values in a non safe way and should fail gracefully or even better deal with XX:MaxRAMPercentage and XX:InitialRAMPercentage (and others).
Also, would love to know if anybody has more experience on running CF 2023 in Kubernetes and some best practices for it. Really interested on Garbage Collection settings for example.

TOPICS
Advanced techniques

Views

259

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 04, 2024 Jan 04, 2024

Copy link to clipboard

Copied

First, I suspect you've surmised the situation well, about the error.

 

And I would recommend that your next step should be to file a bug report at tracker.adobe.com, as I can confirm from my searching there just now that no one else has done so yet. (That's better than hoping someone at Adobe will see this here, plus it gets it considered and tracked for resolution.) Indeed, please share the ticket id/url, and we can add votes to help raise its profile and track any progress from Adobe or thoughts from others. You could also point to the URL for this thread, for added context.

 

Second, this need not be a showstopper for you or anyone using cf containers. Obviously, you can use all other aspects of cf and the CFAdmin fine. And some would point out how it's frowned upon in the container world to make changes to a running container anyway since they're ephemeral.

 

But maybe you're making these changes just to get things "setup".  Maybe you put in that jvm arg change and THEN got the error. As you may know though, there are several solutions to getting a container setup without need of going into the CF Admin within the container:

  • there's provision in the cf containers to auto-import a car file holding admin setting that you've exported from some cf admin 
  • And since cf2021, you can use the cfsetup CLI tool to manage admin settings, including viewing and changing them, as well as exporting/importing them via json. Again, that could be done against another CF instance or even from within the container. But note that there's an env var to import such settings into a cf container at startup, which is nice
  • You can even configure jvm settings on startup of the container, though Adobe doesn't provide for this currently. Instead, it entails some bash fiddling which can be done in a Dockerfile, etc, which I have documented

 

Indeed, I discuss and/or demonstrate such things about working with CF images/containers which I've done in various presentations or blog posts on my site, carehart.org.  Perhaps better still, I show examples of each of the above 3 things (among dozens of other cf container setup variants) which I offer at my github repo, awesome-cf-compose. I realize you're using k8s, but as I note there anyone can use kompose to convert those to kubernetes manifests. I even show a Dockerfile variant for those preferring neither compose nor k8s.

 

Finally, to your last question about GC settings, I'd argue that there's generally no need to tweak them for most folks. It's often done as a case of the tail wagging the dog, in my opinion: if there's gc problem, the solution is rarely in tweaking GC settings (or even changing cf from its default parallelgc algorithm), at least I've not found it to be the solution in thousands of CF troubleshooting engagements, even involving heap issues.

 

Instead, the focus in that case should be on finding and fixing what's CAUSING pressure on the heap, which may be about server config (total memory and heap size), unexpected traffic, cf admin config, coding practices, etc. Here again, I have various resources discussing that, or I have helped folks deal with their specific situations--either here in the community or via an online, very short-term consulting engagement.

 

Long-winded answer to your issue, I realize, but I hope it may help you or others. 🙂


/Charlie (troubleshooter, carehart.org)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 04, 2024 Jan 04, 2024

Copy link to clipboard

Copied

Thank you Charlie!
You are right it does not matter that much in the Docker/Container world but I suspect someone would like to use other memory settings than -Xms and -Xmx, I will log a bug and report back here.
As for the immutability of a container, I could not find a way to get pre-installed modules, having those installed at first start is less than ideal.
I had a look at your compose collection and this is really helpful. I need to dig in the cfsetup CLI tool as I used to have a CFM script from CF 2018 and it feels clunky at best.

As for Garbage Collection, well, it all depends on the memory usage. By default CF is using parallel GC and I guess for most people it will be OK, but for large application with significant number of users having memory going over 4GB would not be surprising. It also depends if you are looking for response time over throughput.
I actually also want to experiment with the Z Collector, but at the end all JVM tuning is black magic and really depends on your application and what it does.
See Java 17 documentation https://docs.oracle.com/en/java/javase/17/gctuning/available-collectors.html#GUID-414C9D95-297E-4EE3...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Jan 04, 2024 Jan 04, 2024

Copy link to clipboard

Copied

Hi Tex,

I have been liking Z collector -XX:+UseZGC and have switch some loads over to it permanently. After trialling Z with JMX and Java logging having known metrics formerly with ParallelGC or G1GC (which I normally apply), GC pause times are very low less than milliseconds typically.

Though loads are not running in containers nor have I trialled XX:MaxRAMPercentage XX:InitialRAMPercentage settings to add meaningful commentary.

 

Regards, Carl.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 06, 2024 Jan 06, 2024

Copy link to clipboard

Copied

LATEST

Hi @NicoTexas ,

  1.  Each percentage setting represents a fraction of the total memory of the physical server or container,. What is the total memory? 
    In any case, 70% seems to me to be too high for a single Java application.

  2.  It is unlikely that the error message,

    "Element JDKPATH is undefined in FORM. The specific sequence of files included or processed is: /opt/coldfusion/cfusion/wwwroot/CFIDE/administrator/settings/jvm.cfm, line: 227"

     is related to the settings you have mentioned. The error may have one of the following two causes, for example. (a) Java's bitness (32 or 64)  doesn't match that of the server or containner. (b) the Java path in your JVM settings is incorrect, typically using \ as separator instead \\ or /.   

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation