Skip to content

Instantly share code, notes, and snippets.

@CodyKochmann
Created February 18, 2020 06:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CodyKochmann/114ad76202bffb64773f16bd33d243c7 to your computer and use it in GitHub Desktop.
Save CodyKochmann/114ad76202bffb64773f16bd33d243c7 to your computer and use it in GitHub Desktop.
ram disk elasticsearch running with zgc
# elasticsearch running on ramdisk and zgc
# by: cody kochmann
docker run --name es --cpuset-cpus 0 --memory-swap 0m --memory 4096m --log-driver journald --tmpfs /usr/share/elasticsearch/data --tmpfs /usr/share/elasticsearch/logs -e discovery.type=single-node -p 127.0.0.1:9200:9200 -e ES_JAVA_OPTS="-XX:MaxGCPauseMillis=100 -Xlog:gc: -XX:MinRAMPercentage=10.0 -XX:CMSInitiatingOccupancyFraction=20 -Xmx2048m -Xms2048m -XX:+PrintFlagsFinal -XX:+ClassUnloading -XX:-UsePSAdaptiveSurvivorSizePolicy -XX:+UseStringDeduplication -XX:-UseGCOverheadLimit -XX:-UseSerialGC -XX:-UseConcMarkSweepGC -XX:-UseG1GC -XX:-UseParallelGC -XX:+UnlockExperimentalVMOptions -XX:+UseZGC -XX:-UseThreadPriorities -XX:+UseDynamicNumberOfGCThreads -XX:HeapSizePerGCThread=5452595 -XX:-UseBiasedLocking -XX:-MaxFDLimit -XX:MaxRAMFraction=2 -XX:MaxRAMPercentage=50.0 -XX:+BackgroundCompilation -XX:CICompilerCount=2 -XX:-PrintCompilation -XX:InlineSmallCode=256M -XX:MaxInlineSize=256M -XX:+DisableExplicitGC" -it --rm docker.elastic.co/elasticsearch/elasticsearch:7.6.0
# running with these settings had me watch my
# ram usage go from a base 2 gigs to 350mb. What t
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment