I'm setting up new CF 2021 servers for an existing...
# adobe
d
I'm setting up new CF 2021 servers for an existing CF 2018 app, and I'm wondering how to go about setting their JVM args in admin. We also have another 2021 app that's running fine, very different app, but about the same load. I could... • Copy them from the other app that's already on 2021. I think this is probably the most sensible option. • Copy them from the 2018 version of this same app. Anyone have any thoughts about known differences between 2018 and 2021 in this regard? • Keep the defaults that came with 2021, and research best practice changes from there. Anyone have any good sources for info like that, ideally one comprehensive page/site?
m
+1 on this. We don't have customized JVM args, but I would also like some resources on the best practices.
s
If they're using the same version of the JRE/JDK, copy the args from the 2018 version. If they're using different JRE/JDK versions, either copy them from the 2021 instance or leave them at default.
In general, Adobe tries to set reasonable defaults so you shouldn't have to change them unless: a) there's a security issue and Adobe has recommended you change them b) there's something weird in a CF update/hotfix that may require you to change them for backward compatibility c) you've done extensive tuning and research and proven that adjusting the JVM args improves things
To be honest, even at work where we're running bare Java/Clojure processes, we hardly provide any non-default behavior via JVM options. We add just these four: •
-XX:-OmitStackTraceInFastThrow
-- stops the JVM "optimizing away" the stack trace for repeated exceptions (so we get better logging on failures) •
-XX:+HeapDumpOnOutOfMemoryError
-- if the JVM runs out of memory, this creates a heap dump file which is sometimes useful for debugging the OoM •
-XX:+UseG1GC -XX:MaxGCPauseMillis=100
-- selects the GC algorithm that we have found works best and optimizes for interactive throughput But, frankly, if you don't really understand what the JVM options are/do, you shouldn't change the defaults. It's very easy to create sub-par performance, or even prevent the JVM from starting up at all, especially on older JVMs (we just upgraded to JDK 21 in production -- I really should review the G1/Z1/etc collectors but the above still seems to work really well for us).
👍 1
j
+1 for Sean's comments. If it ain't broke... FusionReactor is very good for looking at this sort of stuff as well - esp if you have some load tests which can ramp up resource usage.
d
As of right now, our production 2021 app has the following args that I think aren't in the default config: -Dlog4j2.formatMsgNoLookups=true -Dcom.sun.net.ssl.enableECC=false -Dcoldfusion.datemask.useDasdayofmonth=true The 2021 default I'm comparing to here is from the original install, which I've reverted to chasing my inability to apply update 12 to this server. That's due to a low level java crash on every query on every datasource, which I've documented here. Adobe says this issue affects roughly 4 customers, not just us. I've worked with them on it, but they've gone dark about it for a while now, so I'm stuck. In any event, I think those additional args were recommended by Adobe and/or the community here, and the server is stable, knock wood.
j
I thought I created a ticket about this but if I did it must have gotten removed in the recent purge? What would be nice if Adobe allowed you to include a file with your own params that would add/override the defaults. Then you could just transfer this file between versions and not worry about what Adobe added or removed.
s
@Dave Merrill Two of those three fall into my security/hotfix category above 🙂 The sun ssl ECC one is new to me...
Looks like that dates back to Java 1.7 👀 Are you sure it is still needed on more modern JVMs? https://stackoverflow.com/questions/19378921/what-encryption-would-be-used-if-ecc-is-disabled-in-jdk-1-7-jvm
d
No I'm not sure it's still needed, or how to test it. Thoughts? (Besides that I should know my WHOLE stack better than I do I mean.)
Ideally there would be an official Adobe page you could go to with the recommended java args for each supported CF version, with sections for each JVM version that CF version supports if needed, It would need to be kept up to date as security and JVM requirements change. Requiring JVM tuning knowledge to do CF effectively goes against the whole CF development paradigm, and it's silly for every developer to have to research this stuff independently.
s
It used to be that the JVM needed extensive tuning that tended to be custom for every app... these days the GC has improved to the point where you can mostly leave the JVM entirely on its defaults and it will do "well enough" for the vast majority of people.
👍 1
Funnily enough, this coincided today with me researching JDK 21 GC options and reviewing the options (above) and looking at the ZGC -- and deciding that we're probably well enough off with the G1 collector, although we have optimized for small heaps and thus we still need to explicitly select G1 (instead of Serial -- which would be the default for small heaps). The ZGC has even fewer tuning knobs than the G1 collector -- but in both cases Oracle recommends you really try to leave things on the defaults and maybe just tweak
mx
(max heap) and/or the GC pause (which we've adjusted down from the default of 200).
p
@seancorfield -XX:+UseStringDeduplication have you already tried to use this jvm parameters?
s
@paolo79 We have not. Given that it's part of the GC process and only affects long-lived strings, I suspect it would add overhead more than it would help for our apps -- we have a lot of very short-lived objects but very, very few long-lived objects (based on the GC profiles we see via New Relic and the verbose GC logging we do).
Also, all our strings are dealt with as part of i18n handling so there's almost nothing hard-coded into the app and we cache i18n data for performance -- and because we're using Clojure for that, any repeated i18n keys are already interned as keywords so they are deduplicated automatically without touching the GC stuff.