You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add JVM tunning flags in the start scripts for dropwizard #5
It is a big endeavor to attempt fine tuning the JVM arguments.
But some basic stuff will not harm. Use the other Java projects for reference. But note that some of them are using outdated or currently default settings.
The command to get the current settings is: grep -rn10 --include="*.sh" "^java"
-r is a recursive search in the files hierarchy
n tells grep to report the line number in the file if there is a match
--include="*.sh" tells grep to look only in files with .sh extention
"^java" tells grep to search for match only at the beginning of a text line
Update: some setup scripts break the command line on several physical lines with \ at the end of the line. So I've added 10 to the grep options to print the next 10 lines after match.
The special case is: frameworks/Java/act/setup.sh:24:java -server $JAVA_OPTS -Dapp.mode=prod -Dapp.nodeGroup=$GROUP -Dprofile=prod -Dmongo.host=${DBHOST} -Dmysql.host=${DBHOST} -Dpgsql.host=${DBHOST} -cp "$CP" $APP_ENTRY &
JAVA_OPTS="-Djava.security.egd=file:/dev/./urandom -Dawt.useSystemAAFontSettings=on -server -Xms512m -Xmx2g" The change to /dev/urandom SHOULD receive investigation and if affecting results -> rule clarifications
Last time I've checked -XX:+UseNUMA check was not enabled by default in the JVM. The Physical machines are NUMA. So enabling explicitly should help. How much? I can't be sure - don't have access to NUMA machine. But if the test load is generating a lot of garbage which probably is the case it should help. Also it seems that this could help on the cloud instances in Azure: they are using Azure D3v2 which is using Intel® Xeon® Processor E5-2673 v2. It is possible to use 2 physical processors in one server (read the specs). So this instances are NUMA if the servers have 2 physical CPUs.
From the documentation:
The NUMA-aware allocator can be turned on with the -XX:+UseNUMA flag in conjunction with the selection of the Parallel Scavenger garbage collector. The Parallel Scavenger garbage collector is the default for a server-class machine. The Parallel Scavenger garbage collector can also be turned on explicitly by specifying the -XX:+UseParallelGC option.
-server seems not to be needed any more. If the platform is 64-bit and there is more than 2 GB of RAM the JVM is choosing the -server option.
Requests 1 and only 1GB of RAM, adjust call-stack size to 320 kibibytes (kilobytes by the old rulse, thanks to HDD marketing departments), enable NUMA architecture support which helps the GC threads to be local on the CPU for which RAM area they are responsible for cleaning, enable additional bytecode optimizations which are experimental and not enabled by default for the current JVM release version.
Notes about resin:
The current TFB configuration is available in the following two files:
However the option jvm-mode: -server is not described in the documentation. So the -server declaration is moved to jvm-args. Also the requested RAM is decreased to 1GB. Applications are free to change these options in their resin.xml. Also obsolete setting about the perm-gen memory is removed.
Activity
zloster commentedon Mar 22, 2017
The command to get the current settings is:
grep -rn10 --include="*.sh" "^java"-ris a recursive search in the files hierarchyntellsgrepto report the line number in the file if there is a match--include="*.sh"tellsgrepto look only in files with.shextention"^java"tellsgrepto search for match only at the beginning of a text lineUpdate: some setup scripts break the command line on several physical lines with
\at the end of the line. So I've added10to thegrepoptions to print the next 10 lines after match.zloster commentedon Mar 22, 2017
The projects with JVM tunning options:
JAVA_OPTS="
-Djava.security.egd=file:/dev/./urandom -Dawt.useSystemAAFontSettings=on -server -Xms512m -Xmx2g" The change to/dev/urandomSHOULD receive investigation and if affecting results -> rule clarifications-server -Xmx2g -XX:+UseG1GC -XX:MaxGCPauseMillis=10-jar target/*-standalone.jar &-server-jar target/http-kit-standalone.jar &-server-jar target/hello.jar &-Dorg.glassfish.grizzly.nio.transport.TCPNIOTransport.max-receive-buffer-size=16384 -Dorg.glassfish.grizzly.http.io.OutputBuffer.default-buffer-size=1024 -Dorg.glassfish.grizzly.memory.BuffersBuffer.bb-cache-size=32-jar grizzly-bm-0.1-jar-with-dependencies.jar &-server -Xss256k -XX:+UseNUMA -XX:+UseParallelGC -XX:+AggressiveOpts-jar jlhttp-1.0-jar-with-dependencies.jar &-server -XX:+UseNUMA -XX:+UseParallelGC -XX:+AggressiveOpts-jar jooby-1.0.jar &-server -Xms512m -Xmx2g-jar techempower-1.0.0.jar &-server -XX:+UseNUMA -XX:+UseParallelGC -XX:+AggressiveOpts-jar netty-example-0.1-jar-with-dependencies.jar &-Xms2G -Xmx2G -server -XX:+UseNUMA -XX:+UseParallelGC -XX:+AggressiveOpts-Dvertx.disableWebsockets=true -Dvertx.flashPolicyHandler=false -Dvertx.threadChecks=false -Dvertx.disableContextTimings=true -Dvertx.disableTCCL=true -jar vertx.benchmark-0.0.1-SNAPSHOT-fat.jar &-Xms2G -Xmx2G -server -XX:+UseNUMA -XX:+UseParallelGC -XX:+AggressiveOpts-Dvertx.disableWebsockets=true -Dvertx.flashPolicyHandler=false -Dvertx.threadChecks=false -Dvertx.disableContextTimings=true -Dvertx.disableTCCL=true -jar target/vertx-benchmark-1.0.0-SNAPSHOT-fat.jar --instancesgrep --count ^processor /proc/cpuinfo--conf src/main/conf/config.json &-server-jar target/scala-2.11/akka-http-benchmark.jar &-server -XX:+UseNUMA -XX:+UseParallelGC -XX:+AggressiveOpts -XX:+AlwaysPreTouch-jar target/scala-2.11/fintrospectone-jar.jar &Update:
resinis using properties configuration file: https://github.com/TechEmpower/FrameworkBenchmarks/blob/master/toolset/setup/linux/webservers/resin/resin.properties#L82-L84zloster commentedon Mar 22, 2017
Notes:
-XX:+UseNUMAcheck was not enabled by default in the JVM. ThePhysicalmachines areNUMA. So enabling explicitly should help. How much? I can't be sure - don't have access toNUMAmachine. But if the test load is generating a lot of garbage which probably is the case it should help. Also it seems that this could help on the cloud instances in Azure: they are using Azure D3v2 which is using Intel® Xeon® Processor E5-2673 v2. It is possible to use 2 physical processors in one server (read the specs). So this instances areNUMAif the servers have 2 physical CPUs.From the documentation:
-serverseems not to be needed any more. If the platform is64-bitand there is more than2 GBof RAM theJVMis choosing the-serveroption.zloster commentedon Apr 1, 2017
The following are relatively conservative options for the JVM.
Requests 1 and only 1GB of RAM, adjust call-stack size to 320 kibibytes (kilobytes by the old rulse, thanks to HDD marketing departments), enable NUMA architecture support which helps the GC threads to be local on the CPU for which RAM area they are responsible for cleaning, enable additional bytecode optimizations which are experimental and not enabled by default for the current JVM release version.
Notes about
resin:The current TFB configuration is available in the following two files:
However the option
jvm-mode: -serveris not described in the documentation. So the-serverdeclaration is moved tojvm-args. Also the requested RAM is decreased to 1GB. Applications are free to change these options in theirresin.xml. Also obsolete setting about the perm-gen memory is removed.zloster commentedon Apr 2, 2017
Pull request submitted for Dropwizard, Jetty, Resin and Undertow. 2652.
Fix an uncaught exception during dart startup (TechEmpower#3640)