Tips to Optimize the Performance of JMeter and Test Script

  • Increase the capacity of the docker container
  • Improve the performance of JMeter and the running environment


  • JRE: Java Runtime Environment. It is basically the Java Virtual Machine where your Java programs run on. It also includes browser plugins for Applet execution.
  • JDK: It’s the full-featured Software Development Kit for Java, including JRE, and the compilers and tools (like JavaDoc, and Java Debugger) to create and compile programs.

Increase JVM Heap Space


Further Tweak JVM Settings

  • -server: This switches JVM into “server” mode with runtime parameters optimization, as explained above it enables more aggressive compiler optimizations,
  • -XX:+UseConcMarkSweepGC: Enables concurrent Mark Sweep GC which can improve CPU usage on multi-core CPUs,(to see more on GC)
  • -XX:+DisableExplicitGC: Prevents explicit GC Calls. Unfortunately (and in spite of the disclaimers in the documentation), many developers decide they know better than the JVM and call the Garbage Collector programmatically to collect memory. I’m aware of many instances where the -XX:+DisableExplicitGC improved the production environment and zero instances where there were any negative side effects.

Tune the operating system for optimal performance

# Increase system IP port limits 
net.ipv4.ip_local_port_range = 1024 65535
# Decrease TIME_WAIT seconds
net.ipv4.tcp_fin_timeout = 60
# Increase system file descriptor limit
fs.file-max = 2097152
# Reuse TIME_WAIT sockets faster
net.ipv4.tcp_tw_reuse = 1
# Controls the use of TCP syncookies
net.ipv4.tcp_syncookies = 0
# The maximum number of "backlogged sockets""
net.core.somaxconn = 1024
* soft nofile 65535* hard nofile 65535

Upgrade Java and JMeter

  • Java: use the latest 64 bits Java Virtual Machine, as it allows to use of more than 1536 MB or RAM as Xmx,
  • JMeter: latest JMeter versions usually contain many fixes and improvements,
  • JMeter Plugins: make sure to use the latest JMeter Plugins,
  • Operating System: upgrade your operating system to the latest version.

JMeter Non-Gui Mode

  • -n: runs JMeter in non-GUI mode,
  • -t: specifies the path to source .jmx script to run.

Disable Listeners

  • View Results in Table => OutOfMemory guarantee in GUI Mode
  • View Results in Tree => OutOfMemory guarantee in GUI Mode
  • Graph Results => Performance issues
  • Assertion Results => OutOfMemory guarantee
  • Comparison Assertion Visualizer
  • Distribution Graph (alpha) => Performance issues
  • Graph Results => Performance issues

Tune JMeter SaveService

# true when field should be saved; false otherwise# assertion_results_failure_message only affects CSV output
# legitimate values: none, first, all
# response_data is not currently supported for CSV output
# Save ResponseData for failed samples
# Only available with HttpClient4
# Only available with HttpClient4

Distributed Tests

Transactions Per Minute
Processed Bytes in the back-end



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Dilshan Fernando

Dilshan Fernando

Quality Engineering | Test Automation Engineer | AWS Certified Solutions Architect | Problem Solver