skip to content

In a JMeter distributed run, what does the controller actually send to each remote engine?

level: juniorimportance: should knowfreq 50%

answer

  1. One RMI call, one payload
  2. The .jmx travels; its neighbours do not
  3. Relative base directory, not absolute
  4. Runs locally, fails on the servers only

basics

~20 s

The serialised test plan, the script name, a relative base directory, and any properties the controller was told to push. Nothing else. Data files, external script files and element classes must already exist on every server.

solid answer

~50 s

The controller serialises the cloned test tree and passes it to each engine over RMI, together with the script's file name and the base directory expressed **relative** to the JMeter working directory; it then pushes whatever global properties it was given. That is the whole payload. You never copy the `.jmx` to a server by hand - but you do have to place, on every server, every file the plan opens at run time: CSV data, request bodies and upload files, external script files, keystores. Because the tree arrives as serialised Java objects, every element class the plan uses must already be on that server's classpath too, which is why the manual insists all nodes run exactly the same JMeter build. The characteristic symptom is a plan that runs on your machine and fails on the servers only.

go deeper

for a junior

Learn the two halves: the plan travels, its files do not. If a distributed run fails only on the servers, your first guess should be a file or a class that is missing there.

for a middle

Explain the relative base directory. The controller sends the plan directory as a path relative to the JMeter working directory, so a relative filename resolves on each server and an absolute one does not.

for a senior

Treat the servers as deployable artefacts. Show that you ship the plan directory and its data as one unit and keep the JMeter build identical across nodes rather than fixing servers by hand.

for a principal

Decide who owns server state. Make the engines rebuildable from the same source as the plan, so a run never depends on a file somebody copied to one box in a hurry.

## What crosses the wire A distributed start is a small, fixed conversation. The controller clones the test tree, serialises it, and calls the remote engine's configure method with four things: **the test tree**, the host-and-port string the engine was addressed by, **the base directory expressed relative** to the JMeter working directory, and **the script's file name**. It then makes a second call to push the global property set. Finally it calls run. That is the entire payload. There is no file transfer channel in JMeter's remote protocol, no upload of a working directory, and no synchronisation step. The manual is explicit: the plan does not need copying, but *"if the test uses any data files, note that these are not sent across by the client so make sure that these are available in the appropriate directory on each server."* ## What must already be on the server | Artefact | Sent by the controller? | Where it has to be | |---|---|---| | The `.jmx` test plan | Yes, as a serialised tree | Nowhere - it arrives | | CSV data files | No | On every server, at the resolvable path | | Request body / upload files | No | On every server | | External script files a scripting element reads | No | On every server | | Keystores and certificates the plan opens | No | On every server | | Element and plugin classes | No | On every server's classpath | | The controller's own property files | No | Each server loads its own at startup | The last two rows cause the confusing failures. A third-party element that exists only on the controller cannot be deserialised on the server, so the run fails at configure time rather than with a helpful message about a missing plugin. That is the practical reason every node must run the same JMeter build and the same set of installed extensions. ## How the server resolves a relative path The relative base directory is the mechanism that makes relative filenames work at all. Suppose your plan lives in `<jmeter-home>/testplans/checkout/` and reads `data/users.csv`. The controller computes the base as `testplans/checkout` - relative, not absolute - and sends that. Each server sets its own file service base to that relative path, resolved against **its own** JMeter working directory. So if the server has the same directory layout, `data/users.csv` resolves; if its JMeter lives somewhere else on disk, it still resolves, because the path was never absolute. That design fails in exactly two ways, and both are common: - **An absolute path in the plan.** `/Users/you/work/users.csv` is taken as-is and will not exist on a Linux server. - **A different layout on the servers.** If the plan is in a directory the servers do not have, the relative base points at nothing and the file is not found. ## The failure it produces The plan runs clean locally and fails on the servers. Depending on which artefact is missing you get an error at configure time (a class that cannot be deserialised), an error as the engine starts the run (a data file that cannot be opened), or - worst of all - a run that completes on the wrong data, because the file was present but exhausted and the element handed every thread its end-of-file marker: with `Recycle on EOF` turned off and `Stop thread on EOF` left off, JMeter writes the literal `<EOF>` (the `csvdataset.eofstring` default) into each of the element's variables and the samplers keep firing. A file that is missing outright fails loudly instead - the file service throws `IllegalArgumentException: File users.csv must exist and be readable` the first time a thread opens the data set, and that thread dies. ## The habit that prevents it 1. Keep every file path in the plan **relative**, and keep the files under the plan's own directory. 2. Ship the whole plan directory - `.jmx` plus its `data/` and `scripts/` subdirectories - to the same relative location on every server, as one step of the deploy. 3. Install the same JMeter build and the same extensions on every node; do not hand-place a jar on one server only. 4. Run once against a single server before running against six. A missing file surfaces in seconds, not in the middle of a paid load window.

  • Why does an absolute CSV path in a JMeter plan work on your laptop and break on the remote engines?
    The controller sends only a base directory expressed relative to the JMeter working directory; a filename that is already absolute bypasses that and is used verbatim on the server. Unless every server has the identical absolute path, the file is not found. Keep plan file paths relative.
  • What happens if a third-party element in the plan is installed on the controller but not on a server?
    The tree arrives as serialised Java objects, so the server cannot reconstruct an element whose class is missing from its classpath and the configure call fails. Install the same JMeter build and the same extensions on every node.

saying these in an interview costs you the question

  • Believes JMeter copies data files to the servers with the plan.
  • Says the .jmx must be placed on every server by hand.
  • Uses absolute file paths in a plan meant for remote engines.
  • Installs a plugin on the controller only and expects the servers to run it.
  • Assumes the servers pick up the controller's property files.