Question

This is related to JMeter's loop count behaviour.

For the first time I am using JMeter to load test my new web application.
To start with I have configured JMeter to access a simple xhtml page (home.xhtml).

Load configuration in JMeter: 
Number of threads (users): 100
Ramp-Up period (in seconds): 1
Loop count: 100

With the above configuration, I am trying to simulate 100 users accessing the home page URL 100 times each. I am expecting this to simulate a test condition where 100 browser windows are opened by 100 different users and each user accesses the URL 100 times each with the same browser window. So, this should have ideally created 100 sessions only. But in the heap dump at the end of the test, I notice that there were 10,000 (100 x 100) sessions objects.

Session instance’s class: org.apache.catalina.session.StandardSession

This behavior causes heap out of memory error on the Tomcat JVM at higher loads (say 1000 users with loop count of 1000). During my tests, the old gen of the heap (monitored using VisualGC tool that comes with JDK) continues to grow to result in heap out of memory error eventually.

Software used:

Tomcat 7.0.47
JSF 2.2 (Mojarra 2.1.6)
PrimeFaces 4.0
JMeter 2.11 (To create the load)
VisualVM (To monitor memory consumption & take heap dump)
Eclipse Memory Analysis Tool (MAT) 1.3 – Used to analyse the heap.

My inference from the heap analysis: As I am seeing 10,000 session instances in the heap, I am inferring that JMeter is simulating 10,000 users with my above configuration instead of simulating 100 users with 100 URL access each.

Question: Is JMeter’s this loop count behaviour expected or am I missing something?

Was it helpful?

Solution

If you don't add an HTTP Cookie Manager, then each request will be seen as a different User by server.

To simulate 100 VUs, just add a Cookie Manager to your Test Plan and it will do it.

Each "VU" will be looping 100 times.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top