0
votes

I have a simple JMeter test plan that has a single HTTP sampler that posts a 2MB JSON payload. We have configured the test to achieve 50 transactions per second with 50 to 75 threads backed up by ultimate thread group and throughput shaping timer. JMeter is running with 8GB heap configuration and G1GC algorithm on a Mac with Oracle JDK/jre.

Structure

Ultimate Thread Group Throughput shaping timer HTTP Sampler with 2MB - JSON file in the body field JSON Assertion HTTP header manager

Options that were tested 1. 10 Threads / 10 TPS - still memory consumption is from 3GB to 8GB 2. Used __StringFromFile to read the payload from a file and then using it both as a variable using ${} and also as a property with $__P. The memory overhead remains the same in both the options 3. OS process sampler configured to use CURL which was better and consumed only 500 MB with 10 threads. But I want to know if there is a better option to achieve this within the hTTP sampler itself. i.e., achieve more throughput per JVM with an 8GB Configuration.

enter image description here

1

1 Answers

1
votes

In order to minimize JMeter's memory consumption when it comes to sending large files you can use HTTP Raw Request sampler

It has a special mode allowing direct streaming of the file to the endpoint avoiding prior reading it into the memory so you can send the files of whatever size without any impact to JMeter's heap space.

You can install HTTP Raw Request sampler using JMeter's Plugins Manager

enter image description here