Working with big files/calling external scripts in JMeter

(This article is part of the JMeter Series)

JMeter’s “HTTP Request Sampler” will read the whole input (the downloaded page, pdf, movie etc.) into its main memory. That means that working with larger (f.ex. movies) files will bring JMeter, the JVM and/or many machines to their memory limits.

If you do not not need to do more than making sure that something gets downloaded, then you can “offload” the download work to an outside process, f.ex. to curl or wget:

Downloading with curl Screenshot

A few things to note:

  • I used the “BeanShell Sampler” module, since both the “BeanShell Pre-” and the “PostProcessors” are only executed when there’s something to process after another sampler produced some data.

  • As you can see, we are passing a JMeter variable to the script

  • Aparently JMeter or the BeanShell do not care much about the output of the exec’ed script, thus you won’t see anything inside the “Response data” in the “View Results Tree Sampler”. I don’t know whether that behaveour is a missing feature, a bug or for some unknown reason intended as such.

You can download this JMeter test from here

Tomáš Pospíšek, 30.12.2010