
Jmeter 优化 Tips
ü Generate Reports after run: use the outputted JTL files to create reports once the load test is
finished. Building the report requires a great amount of CPU and memory resources.
ü Network is the bottleneck in most cases: Which means it’s better to have medium machines with
great network connectivity instead of powerful machines with low network capabilities.
ü Avoid BeanShell scripts: those scripts use way more CPU to execute than Groovy scripts
embedded in JSR223 samplers. Stick to JSR223 samplers if you need to run custom logic.
ü Do not run in distributed mode: distributed mode works well with 20-30 machines, maybe up to
40-50 machines if you have luck. This will limit you to 20-50k concurrent users. Instead, run each
JMeter instance independently by sending the JMX before starting the test, and retrieving the JTL
files after finish. The RMI protocol used by JMeter to communicate between the load generators and
the controller is not very efficient.
ü Monitor tested servers: The key to find performance bottlenecks is to monitor the tested backend
servers which running the load test. You will be able to correlate performance degradations with
server-side issues. This way, you can fix the performance issue on backend side quicker. Tools
like Perfmon are recommended.
ü Run load tests in-house first: this may sound weird, but the nearer the load generators are from
the tested servers, the less factors are likely to influence the performance testing results. On-
Premise load tests avoid internet connectivity issues and can use large internal networks (usually 1
to 10 Gbps). Once the servers are well-performing with on-premise testing, testing from the cloud
can reveal internet networking issues. This way, you can separate server issues from network
issues.