Java/JVM tuning question: it’s been years since I’...
# cfml-general
s
Java/JVM tuning question: it’s been years since I’ve played around with java settings for CF. That being said I know there are some teams out there that have made some great improvement to their JVM config to supercharge their setup. Would anyone be willing to share what JVM Args you/your team is using in production to squeeze more performance out of your servers?
e
First you start out with the requirements then you start with the memory and then you can come up with the solution. What version of CF, what version of Java, What is your Webserver front end, how many standard active sessions, how many sessions per second, hardware, memory, processors, disk size, type, speed, workload, all of that just for a baseline and then use some stress tool to further tweak the settings, Otherwise here is the "generic" suggestion, set memory to 70 to 95 percent of your host, depending on OS, 70 Windows, 95 UNIX. This is what I suggest just as a base if you had a machine running some kind of UNIX with 4.5 GB of memory as an example XX:MaxNewSize=1024m -XX:SurvivorRatio=10 -Xmsm4096m -Xmx4096m -Xgc: parallel -Xns256m -XXaggressive:memory To
s
Thank you for those suggestions. I have a few droplets running lucee on debian and the machines have between 4-8 Gigs of ram and 2-4 processors. For the most part they are handling just fine but i was always curious if there were settings for java that would focus its performance towards the nature/environment of the CF engine. I have come across the heap size settings before but the rest are new to me! I will do some research on those 🙂
e
newer versions of java have a few more options in handling how the JVM works. My train of thought is, to run as much in memory as possible as memory is faster than disk. Instead of having a massively changing memory allocation, just set it to a fixed size and if your application needs more, either spin up more VMs or allocate more resources, either way, it's a hard point for use in scaling and performance tuning. as for OS choice, good one! Windows even the later non-gui versions still is a bit piggy and slower in terms of performance than other platforms. As for Debian, I would look at the overhead added by all the tossed-in modules for apache if you are running apache + modJK.
s
I have nginx set up with reverse proxy (which i would imagine would be pretty low overhead), and using commandbox to handle the requests. which means currently i have a few CF servers running on the box. And even that i am wavering on doing a full install of lucee on the box or using commandbox new modcfml feature to run it all through one commandbox server.
e
Nginx is fast serving static traffic but is about the same vs apache when it comes to dynamic content. In high memory / high resource available environments you would want apache over Nginx for dynamic content and use Nginx for delivering static content. If you literally are doing nothing with the web server static, you could just use port iptables transport and just use the native Wildfly stack. As for a full Lucee install, the install is simple and straightforward and cleaner than commandbox in terms of the mechanics of it, plus performance wise its a nearly 3 percent uptick in performance over commandbox.