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]
More Related questions...
