Prev Next

Testing / Apache JMeter Interview questions

Explain the internal working of JMeter's distributed (master-slave) testing architecture?

In this architecture, one machine runs as the controller (sometimes still called the "master"), issuing commands, while one or more remote engines ("slaves" or agents) actually execute the test plan and generate load - the controller itself typically doesn't generate significant load on its own during a distributed run.

Communication happens over Java RMI (Remote Method Invocation): each remote engine runs a JMeter server process listening on a specific RMI port, and the controller connects to each configured remote engine's address to distribute the test plan and issue start/stop commands.

When a distributed test starts, the controller sends the compiled test plan to each remote engine, and each engine begins executing it independently and locally, generating its own share of the configured load against the system under test - the engines aren't coordinating load generation with each other directly, each just runs its own copy of the test plan.

As samples are generated on each remote engine, they're streamed back to the controller in near real time rather than only being collected at the very end, which is what lets a controller-side listener show aggregated, live results across the whole distributed test as it runs - though this streaming itself adds network and processing overhead on the controller that's worth accounting for at very large agent counts.

When the test completes (or is manually stopped), the controller signals all remote engines to shut down execution, and any final sample data still in transit is collected before the controller reports the test as fully finished; results saved to a file are typically written per-engine unless explicitly configured to consolidate through the controller.

flowchart TD
  A[Controller: sends test plan via RMI] --> B[Remote Engine 1: runs test plan, generates load]
  A --> C[Remote Engine 2: runs test plan, generates load]
  A --> D[Remote Engine N: runs test plan, generates load]
  B --> E[Samples streamed back to controller]
  C --> E
  D --> E
  E --> F[Controller aggregates/reports results]
Communication between the controller and remote engines happens over:
During a distributed run, remote engines:

More Related questions...

What is Apache JMeter? What is a Test Plan in JMeter? What is a Thread Group in JMeter? What is a Sampler in JMeter? What are Listeners in JMeter? What is a Config Element in JMeter? What are Timers in JMeter? What are Assertions in JMeter? Define a Logic Controller in JMeter? What is the CSV Data Set Config element? What is the HTTP(S) Test Script Recorder? Describe the Aggregate Report listener? What is a Regular Expression Extractor? What is Non-GUI mode in JMeter? What are Pre-Processors and Post-Processors in JMeter? What is the Constant Timer? Describe the HTTP Cookie Manager? What is a JMeter Property? List the protocols JMeter supports for load testing? How do you record a test script in JMeter? What is the difference between a Sampler and a Controller in JMeter? How does the ramp-up period affect a JMeter test? Why should you avoid running load tests in GUI mode? What is the difference between Correlation and Parameterization? How does the CSV Data Set Config distribute data across threads? When should you use a Transaction Controller? What is the difference between JSR223 and BeanShell elements? How do JMeter Assertions differ from Post-Processors? What is the difference between Response Time and Latency in JMeter? Why is the View Results Tree listener discouraged during load runs? How does the Constant Throughput Timer control request rate? What is the difference between a Loop Controller and a While Controller? When should you use the If Controller versus a separate Thread Group? How do you pass command-line properties into a JMeter test? What is the difference between master-slave distributed testing and running tests locally? How does JMeter's Cache Manager simulate real browser behavior? What is the difference between load testing, stress testing, and spike testing? Why do you need to correlate dynamic values like session tokens? Explain the execution flow of a JMeter test plan with nested thread groups and controllers? How can you optimize JMeter for generating high load with limited hardware? How do you troubleshoot inconsistent response times across distributed JMeter load generators? Explain the internal working of JMeter's distributed (master-slave) testing architecture? How can you optimize a test plan for lower memory use in a soak test? Which is better for extracting dynamic values: Regular Expression Extractor or JSON Extractor, and why? How do you troubleshoot a JMeter test producing artificially low response times due to caching? Explain the lifecycle of a single HTTP sampler request through JMeter's processor chain? How can you optimize correlation for an application using rotating CSRF tokens? How do you troubleshoot a connection reset spike during scaled-up load? Explain the execution flow of generating an HTML dashboard report from a JTL results file? How can you optimize JMeter script maintainability for a large, growing regression suite?
Show more question and Answers...

API

Comments & Discussions