JMeter FAQ

This section compiles common questions and solutions when using Apache JMeter.

Installation Issues

Q1: Running JMeter shows "java" is not recognized as an internal or external command

A: Ensure Java is properly installed and configured. Verify in command line:

java -version

If not installed, download and install Java JDK 8 or higher. For Windows, also set JAVA_HOME environment variable.

Q2: JMeter interface shows garbled characters

A: This is caused by font encoding issues. Solution:

  1. Open bin/jmeter.properties file
  2. Add or modify:
    sampleresult.default.encoding=UTF-8
    
  3. Restart JMeter

Q3: JMeter runs out of memory and crashes

A: Default heap size may be insufficient. Adjust:

  • Windows: Edit bin/jmeter.bat, find set HEAP parameter and increase
  • Linux/Mac: Edit bin/jmeter, adjust HEAP variable Recommended 2GB or higher:
HEAP="-Xms2g -Xmx2g"

Test Execution Issues

Q4: How to simulate multiple different user logins?

A: Use parameterization:

  1. Create CSV file with usernames and passwords
  2. Add "CSV Data Set Config" element
  3. Use ${username} and ${password} variables in HTTP requests

A: Ensure appropriate elements are added:

  1. Add "HTTP Cookie Manager" to thread group
  2. For tests requiring login, ensure "Clear cookies each iteration" is properly configured
  3. Check if requests correctly carry Cookies

Q6: Chinese characters in response data display as garbled

A: Solutions:

  1. Add or modify "Content Encoding" to UTF-8 in HTTP Request
  2. Set default encoding in "HTTP Request Defaults"
  3. Use "Regular Expression Extractor" in post-processor and specify encoding

Q7: How to handle HTTPS certificate issues?

A: For test environments:

  1. Import trusted certificates into Java cacerts store
  2. Or set "Implementation" to Java in HTTP Request
  3. For self-signed certificates, may need to import JMeter's truststore

Q8: Memory keeps growing during long test runs

A: Recommended measures:

  1. Reduce data collected by listeners
  2. Run tests in command-line mode
  3. Increase garbage collection frequency in jmeter.properties:
    mode=Stripped
    
  4. Clean result files regularly

Performance Issues

Q9: JMeter cannot generate enough load

A: Try these methods:

  1. Use distributed testing (remote testing)
  2. Adjust thread count and loop count
  3. Reduce unnecessary listeners
  4. Use command-line mode instead of GUI mode
  5. Check if network bandwidth is the bottleneck

Q10: Response time fluctuates greatly in test results

A: Possible causes and solutions:

  1. Server-side GC or caching issues
  2. Unstable network
  3. Test data has dependencies
  4. Use Synchronizing Timer to ensure concurrent requests
  5. Increase warm-up time, let server stabilize before collecting statistics

Q11: How to set reasonable concurrency?

A: Recommended approach:

  1. Start with lower concurrency (10-50)
  2. Gradually increase concurrency and observe system response
  3. Find the performance inflection point (response time starts increasing)
  4. Determine maximum safe concurrency
  5. Perform stress testing to verify system limits

Reporting and Results Analysis

Q12: How to generate HTML reports?

A: Use command line:

jmeter -n -t test_plan.jmx -l results.jtl -e -o /path/to/report

Or generate from existing results file:

jmeter -g results.jtl -o /path/to/report

Q13: What do the metrics in Aggregate Report mean?

  • Samples: Total number of requests
  • Average: Average response time in milliseconds
  • Median: Median response time
  • 90%/95%/99% Percentile: 90%/95%/99% of requests respond faster than this value
  • Min/Max: Minimum and maximum response time
  • Error %: Percentage of failed requests
  • Throughput: Number of requests processed per second

Q14: Result file is too large

A: Solutions:

  1. Save as CSV format in listeners
  2. Configure to save only necessary fields
  3. Use "Distributed Testing" to distribute storage
  4. Rotate result files regularly

Scripting Issues

Q15: How to handle dynamically changing parameters?

A: Common methods:

  1. Use "Regular Expression Extractor" to extract from response
  2. Use "JSON Extractor" to extract JSON data
  3. Use "CSS/JQuery Extractor" to extract HTML elements
  4. Use "XPath Extractor" to extract XML data

Q16: BeanShell scripts cannot run

A: Ensure:

  1. JDK is properly installed (not JRE)
  2. BeanShell library files are in lib directory
  3. Check script syntax is correct

Q17: How to implement complex business logic?

A: Can use:

  1. Logic Controller combinations
  2. BeanShell or JSR223 scripts
  3. Pre/Post processors
  4. Throughput Controller for conditional execution

Other Issues

Q18: What is the difference between JMeter and browsers?

JMeter works at protocol level, it is not a browser:

  • Does not execute JavaScript
  • Does not render HTML pages
  • Does not handle CSS
  • Cannot simulate all browser behaviors

Q19: How to learn JMeter?

Recommended learning path:

  1. Read JMeter's official user manual
  2. Start with simple HTTP requests
  3. Learn parameterization and correlation
  4. Master distributed testing
  5. Learn custom script development

Q20: What operating systems does JMeter support?

JMeter is a pure Java application and supports any OS with Java installed, including Windows, Linux, Mac OSX, Solaris, and more.