# Apache JMeter — Load Testing Tool for Web Applications > Apache JMeter is a Java-based open-source tool for load testing, performance measurement, and functional testing of web applications, APIs, databases, and other networked services. ## Install Save in your project root: # Apache JMeter — Load Testing Tool for Web Applications ## Quick Use ```bash # Download and extract wget https://dlcdn.apache.org/jmeter/binaries/apache-jmeter-5.6.3.tgz tar xzf apache-jmeter-*.tgz # Launch the GUI for test plan design ./apache-jmeter-*/bin/jmeter # Run a test plan in non-GUI mode (recommended for load tests) jmeter -n -t test-plan.jmx -l results.jtl -e -o report/ ``` ## Introduction Apache JMeter has been the workhorse of load testing since 2003. It can simulate heavy loads on servers, networks, and services to measure performance and identify bottlenecks. Its GUI makes test design accessible, while non-GUI mode handles serious load generation. ## What JMeter Does - Simulates concurrent users sending HTTP, HTTPS, SOAP, REST, and GraphQL requests - Tests databases via JDBC, message brokers via JMS, and mail servers via SMTP/POP3 - Records browser sessions and converts them into replayable test plans - Generates HTML dashboards with response time percentiles, throughput, and error rates - Supports assertions, timers, and logic controllers for realistic user behavior modeling ## Architecture Overview JMeter runs on the JVM. A test plan is an XML file (.jmx) organized as a tree of thread groups, samplers, controllers, and listeners. Each thread group spawns virtual users that execute samplers sequentially or in loops. Results flow through listeners for real-time or post-test analysis. Distributed testing uses a controller-worker architecture where one master coordinates multiple worker JVMs. ## Self-Hosting & Configuration - Requires Java 8+ (Java 17+ recommended for JMeter 5.6+) - Configure JVM heap in `jmeter.bat` or `jmeter.sh` (e.g., `-Xmx4g`) - Use `user.properties` to set default encoding, SSL protocols, and proxy settings - For distributed tests, list worker IPs in `remote_hosts` property - Integrate with CI via Maven JMeter plugin or the jmeter-n command in pipelines ## Key Features - HTTP(S) Test Script Recorder: captures browser traffic as test steps - CSV Data Set Config: parameterize requests with external data files - Correlation: extract values from responses with regex or JSON path extractors - Pluggable architecture: 100+ plugins via JMeter Plugins Manager - HTML report generation with aggregate graphs, percentile charts, and error summaries ## Comparison with Similar Tools - **k6** — scriptable in JavaScript, lower resource usage; JMeter has a GUI and broader protocol support - **Gatling** — Scala DSL, better for code-first teams; JMeter has a larger community and plugin ecosystem - **Locust** — Python-based distributed testing; JMeter supports more protocols out of the box - **Artillery** — YAML/JS config, cloud-native; JMeter offers more granular request configuration ## FAQ **Q: Should I use the GUI for running load tests?** A: No. Use the GUI only for designing and debugging test plans. Run actual load tests in non-GUI mode (`jmeter -n`) to avoid overhead. **Q: How many virtual users can one JMeter instance handle?** A: Typically 500-2000 threads per machine depending on hardware and test complexity. Use distributed mode for higher loads. **Q: Can JMeter test WebSocket or gRPC endpoints?** A: Yes, via community plugins. The WebSocket Samplers and gRPC Request plugins are available through JMeter Plugins Manager. **Q: How do I integrate JMeter with CI/CD?** A: Use the Maven JMeter plugin, run in non-GUI mode in a Docker container, or use cloud services that accept .jmx files. ## Sources - https://github.com/apache/jmeter - https://jmeter.apache.org/usermanual/ --- Source: https://tokrepo.com/en/workflows/344ba46e-3f31-11f1-9bc6-00163e2b0d79 Author: AI Open Source