Skip to content
Tutorials Center
My learning

Topics

Lesson 1 of 37 ยท Getting Started

What Is Apache JMeter?

Learn what Apache JMeter is, what it can test, how it simulates virtual users with threads, and where it fits next to browsers, k6 and Gatling.

Apache JMeter is a free, open-source tool for load and performance testing. It is a desktop and command-line Java application that sends requests to a server, many at a time, and records how long each answer takes and whether it was correct. You describe a test in a test plan, press start, and JMeter plays the part of hundreds or thousands of users at once.

It began in the late 1990s as a way to test Apache web servers, but today it speaks many protocols: HTTP and HTTPS, REST and SOAP, databases through JDBC, FTP, LDAP, SMTP and IMAP, TCP, JMS message queues and more. This lesson explains what JMeter is, what it is not, and how its "virtual user" idea works.

Honesty note. JMeter is a Java desktop application and cannot run inside this website. Menu paths, file formats and command lines are described exactly as JMeter documents them. The runnable blocks are small JavaScript stand-ins: they simulate the ideas (virtual users, response times, percentiles) so you can experiment, but they are not JMeter and produce no JMeter output.

What JMeter does

A load test answers questions such as: how fast is the checkout page when 500 people use it together? At what number of users do errors begin? Does memory grow during an eight-hour run? JMeter helps in four ways:

  • Generate load. It creates many concurrent threads, each acting as one user.
  • Send realistic traffic. Samplers build requests; config elements add headers, cookies and data files.
  • Check answers. Assertions mark a response as failed when the status, text or time is wrong.
  • Measure and report. Listeners and the HTML dashboard report average, percentile and maximum times, throughput and error rate.

Protocols, not browsers

This is the most important idea to absorb early. JMeter works at the protocol level. It sends an HTTP request and reads the bytes that come back, exactly as curl would. It does not open a browser. Consequences:

  • It does not run JavaScript, so a page that builds its content in the browser looks nearly empty to JMeter. You must call the underlying API endpoints instead.
  • It does not render pages, so it cannot measure "time until the page looks ready". It measures server and network time.
  • It is very cheap per user. One ordinary computer can drive thousands of virtual users, where thousands of real browsers would be impossible.

If you need to measure rendering, use a browser-based tool next to JMeter. For protocol-level load, JMeter is a strong fit.

Virtual users are threads

Each JMeter virtual user is a Java thread. A Thread Group says how many threads to start, how fast, and how many times each should run its list of requests. A thread runs its samplers in order, waits, and loops. If a thread group has 100 threads, 100 "users" send requests at overlapping times.

flowchart LR
  TP["Test Plan (.jmx file)"] --> TG["Thread Group<br/>100 threads"]
  TG --> U1["User 1: login, search, buy"]
  TG --> U2["User 2: login, search, buy"]
  TG --> U3["... User 100"]
  U1 --> S["System under test"]
  U2 --> S
  U3 --> S
  S --> R["Results: times, errors, throughput"]

Every thread repeats the same scenario against the server; JMeter records one result per request.

The stand-in below mimics this. Each simulated user "sends" requests whose times come from a seeded random generator (so you get the same numbers each run), then it prints the statistics a JMeter summary would show.

JS Stand-in: simulated virtual users and a summary

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Notice how a few slow outliers lift the maximum and the 90th percentile far above the average. Later lessons show why percentiles matter more than averages.

What a JMeter test looks like

A test is a tree of elements saved as an XML file with the extension .jmx. A tiny plan might contain:

TEXT
Test Plan
โ””โ”€โ”€ Thread Group (50 threads, ramp-up 10 s, loop 20)
    โ”œโ”€โ”€ HTTP Request Defaults (server: shop.example.test)
    โ”œโ”€โ”€ HTTP Request: GET /products
    โ”œโ”€โ”€ Response Assertion (status is 200)
    โ””โ”€โ”€ Summary Report

You build this in the GUI, save it as shop.jmx, and then run it from the command line for the real test. Because .jmx is text, it works with Git, code review and CI. Your first test plan walks through building exactly such a plan.

GUI mode versus non-GUI mode

JMeter has two ways to run:

  • GUI mode is for building and debugging plans: you click, run with a handful of users, and inspect responses.
  • Non-GUI (CLI) mode is for real load: jmeter -n -t shop.jmx -l results.jtl. It uses less memory and CPU, so the tool itself does not become the bottleneck.

The rule to remember: design in the GUI, load test from the command line.

Strengths and limits

Strength Limit
Free, mature, huge plugin ecosystem Java threads cost memory; very large tests need several machines
Many protocols in one tool No JavaScript execution or page rendering
GUI helps beginners build plans visually GUI-built plans are verbose XML, harder to review than code
Built-in HTML report and CI-friendly CLI Scripting uses Groovy/Java, a learning step

Other tools such as k6, Gatling and Locust take a code-first approach; JMeter takes a GUI-first approach that is friendlier at the start. Many teams use both: JMeter for protocol coverage, others for developer-owned tests.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What does JMeter use to represent one virtual user?

    Each virtual user is a thread inside the JMeter JVM that runs the samplers of its Thread Group.
  2. 2. Why can't JMeter measure how long a page takes to render in the browser?

    JMeter sends and receives protocol messages. It never runs page scripts or paints pixels.
  3. 3. Which way of running is recommended for a real, heavy load test?

    The GUI consumes resources and can distort results. Use it to build and debug, and run the load from the command line.
  4. 4. What file format does JMeter use to save a test plan?

    Test plans are XML files with the .jmx extension, which makes them easy to version-control.

Summary

  • JMeter is a free, open-source Java tool for load and performance testing of many protocols.
  • Virtual users are threads; a Thread Group controls how many and how fast.
  • It works at the protocol level: no browser, no JavaScript, no rendering time.
  • Plans are .jmx XML files; build in the GUI, run load in non-GUI mode.
  • Percentiles reveal slow outliers that averages hide.

Next: Performance Testing Basics