You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Sonam Chauhan <so...@ce.com.au> on 2007/05/09 08:46:24 UTC

maximum number of threads per JMeter instance

Hi -  

 

Can someone point me to documentation on the maximum number of threads a
single JMeter instance can handle? (I cannot find this information on
Google or the wiki.) 

 

I have a problem with a testcase that has a large number of threads - it
has 2 thread groups with 2000 and 5000 threads each. On a Windows XP SP2
system with 2GB of RAM, java.exe grows to about 350MB before throwing
this exception: 

-------------------------

Exception in thread "Thread-1" java.lang.OutOfMemoryError: unable to
create new native thread

        at java.lang.Thread.start0(Native Method)

        at java.lang.Thread.start(Thread.java:574)

        at
org.apache.jmeter.engine.StandardJMeterEngine.run(StandardJMeterEngine.j
ava:387)

        at java.lang.Thread.run(Thread.java:595)

-------------------------

 

The JMeter version is 2.1.1 and the Java version is "1.5.0_10"

-------------------------

Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_10-b03)

Java HotSpot(TM) Client VM (build 1.5.0_10-b03, mixed mode)

-------------------------

 

I tried tweaking two JMeter run script settings: HEAP and NEW. I started
small, and increased the numbers proportionally up until Xmx=1024m but
it was little use - the more I increased HEAP size, the faster I got the
outOfMemory errors. 

 

I also came across some interesting information here about the maximum
number of threads per process: 

 
http://blogs.msdn.com/oldnewthing/archive/2005/07/29/444912.aspx 

I tried using '-Xss128k' to reduce stack size per Java thread, but that
did not help either. 

 

Kind regards,

Sonam Chauhan

-- 

Corporate Express Australia Ltd. 

Phone: +61-2-93350725, Email: sonam.chauhan@ce.com.au

 


RE: maximum number of threads per JMeter instance

Posted by "Oliver Erlewein (DSLWN)" <Ol...@datacom.co.nz>.
Just an aside on that, it seems that Java can only open 2000 sockets so
you will be limited there. That doesn't depend on available hardware. I
get around that by executing multiple JVM's on the same machine. It
works like a charm.

Cheers Oliver 

-----Original Message-----
From: sebb [mailto:sebbaz@gmail.com] 
Sent: Wednesday, 9 May 2007 21:52
To: JMeter Users List
Subject: Re: maximum number of threads per JMeter instance

There is no documentation, because there is no fixed limit - it depends
on the test plan, OS, JVM, hardware, network etc..

The only way to determine the limit is to try.  For example, if it works
OK for a particular scenario with 10 threads but not with 15, then the
limit is somewhere between 10 and 15.

Having said that, 2000 or more threads is a pretty large number, so I'm
not entirely surprised that there are memory problems. Some OSes have
limits to the number of open sockets, even if memory is not a problem.

That number of threads is also potentially a huge load on whatever
server is under test - do you really need to run with 7000 threads?

As a work-round:
- use non-GUI mode
- remove all but one listener
- use CSV output
- minimise assertions
- use multiple independent jobs, and combine the results.

On 09/05/07, Sonam Chauhan <so...@ce.com.au> wrote:
> Hi -
>
>
>
> Can someone point me to documentation on the maximum number of threads

> a single JMeter instance can handle? (I cannot find this information 
> on Google or the wiki.)
>
>
>
> I have a problem with a testcase that has a large number of threads - 
> it has 2 thread groups with 2000 and 5000 threads each. On a Windows 
> XP SP2 system with 2GB of RAM, java.exe grows to about 350MB before 
> throwing this exception:
>
> -------------------------
>
> Exception in thread "Thread-1" java.lang.OutOfMemoryError: unable to 
> create new native thread
>
>        at java.lang.Thread.start0(Native Method)
>
>        at java.lang.Thread.start(Thread.java:574)
>
>        at
> org.apache.jmeter.engine.StandardJMeterEngine.run(StandardJMeterEngine
> .j
> ava:387)
>
>        at java.lang.Thread.run(Thread.java:595)
>
> -------------------------
>
>
>
> The JMeter version is 2.1.1 and the Java version is "1.5.0_10"
>
> -------------------------
>
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_10-b03)
>
> Java HotSpot(TM) Client VM (build 1.5.0_10-b03, mixed mode)
>
> -------------------------
>
>
>
> I tried tweaking two JMeter run script settings: HEAP and NEW. I 
> started small, and increased the numbers proportionally up until 
> Xmx=1024m but it was little use - the more I increased HEAP size, the 
> faster I got the outOfMemory errors.
>
>
>
> I also came across some interesting information here about the maximum

> number of threads per process:
>
>
> http://blogs.msdn.com/oldnewthing/archive/2005/07/29/444912.aspx
>
> I tried using '-Xss128k' to reduce stack size per Java thread, but 
> that did not help either.
>
>
>
> Kind regards,
>
> Sonam Chauhan
>
> --
>
> Corporate Express Australia Ltd.
>
> Phone: +61-2-93350725, Email: sonam.chauhan@ce.com.au
>
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: maximum number of threads per JMeter instance

Posted by sebb <se...@gmail.com>.
There is no documentation, because there is no fixed limit - it
depends on the test plan, OS, JVM, hardware, network etc..

The only way to determine the limit is to try.  For example, if it
works OK for a particular scenario with 10 threads but not with 15,
then the limit is somewhere between 10 and 15.

Having said that, 2000 or more threads is a pretty large number, so
I'm not entirely surprised that there are memory problems. Some OSes
have limits to the number of open sockets, even if memory is not a
problem.

That number of threads is also potentially a huge load on whatever
server is under test - do you really need to run with 7000 threads?

As a work-round:
- use non-GUI mode
- remove all but one listener
- use CSV output
- minimise assertions
- use multiple independent jobs, and combine the results.

On 09/05/07, Sonam Chauhan <so...@ce.com.au> wrote:
> Hi -
>
>
>
> Can someone point me to documentation on the maximum number of threads a
> single JMeter instance can handle? (I cannot find this information on
> Google or the wiki.)
>
>
>
> I have a problem with a testcase that has a large number of threads - it
> has 2 thread groups with 2000 and 5000 threads each. On a Windows XP SP2
> system with 2GB of RAM, java.exe grows to about 350MB before throwing
> this exception:
>
> -------------------------
>
> Exception in thread "Thread-1" java.lang.OutOfMemoryError: unable to
> create new native thread
>
>        at java.lang.Thread.start0(Native Method)
>
>        at java.lang.Thread.start(Thread.java:574)
>
>        at
> org.apache.jmeter.engine.StandardJMeterEngine.run(StandardJMeterEngine.j
> ava:387)
>
>        at java.lang.Thread.run(Thread.java:595)
>
> -------------------------
>
>
>
> The JMeter version is 2.1.1 and the Java version is "1.5.0_10"
>
> -------------------------
>
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_10-b03)
>
> Java HotSpot(TM) Client VM (build 1.5.0_10-b03, mixed mode)
>
> -------------------------
>
>
>
> I tried tweaking two JMeter run script settings: HEAP and NEW. I started
> small, and increased the numbers proportionally up until Xmx=1024m but
> it was little use - the more I increased HEAP size, the faster I got the
> outOfMemory errors.
>
>
>
> I also came across some interesting information here about the maximum
> number of threads per process:
>
>
> http://blogs.msdn.com/oldnewthing/archive/2005/07/29/444912.aspx
>
> I tried using '-Xss128k' to reduce stack size per Java thread, but that
> did not help either.
>
>
>
> Kind regards,
>
> Sonam Chauhan
>
> --
>
> Corporate Express Australia Ltd.
>
> Phone: +61-2-93350725, Email: sonam.chauhan@ce.com.au
>
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


RE: maximum number of threads per JMeter instance

Posted by iblavins <ib...@temenos.com>.
G'day

The number of threads that JMeter can run simultaneously depends on a number
of variables. 

One (as you have discovered) is the amount of memory allocated to JMeter.
This has to be sufficient to provide memory for the running threads which
run within JMeter. The memory used by a thread depends on the content of
your test plan. So if you are running out of memory (which is what your
error message is saying) you can either increase the amount of memory
allocated to JMeter, or run a simpler test plan, or run less threads, or use
JMeter server. If you run JMeter server on n boxes then you get n lots of
JMeter memory to support the running threads.

To increase the memory for JMeter use the JMeter heap execution parameter
(see the JMeter.bat procedure).

Note that as you approach the limits of JMeter memory JMeter (or, strictly,
the JVM) will spend more and more of its resources garbage collecting. For
performance you want to avoid this so ideally JMeter's memory allocation
should be sufficiently generous that garbage collection becomes a minor
background drain on resources.

When you get past your memory problem I wouldn't be surprised if your test
still doesn't run very well. 5,000 threads is a lot to handle. If you
haven't put pacing into the test plan (ie some kind of delay or timer to
limit the speed at which each thread sends its work) then you may well
overwhelm either the JMeter host or the system under test.

Again how many threads you will get depends on the resources consumed by
each thread, both on the JMeter host and on the system under test. This is
turn is dependent on the content of your test plan and the nature of your
samplers and the target application. 

Considering only the JMeter resource consumption, if you find that the
JMeter host can't handle the number of threads you want the resolution is
the same as for running out of memory: more of the resource, simpler test
plan, less threads, or JMeter server. (Some test plan elements are known to
be resource consumptive - see the User Manual.)

However when a run doesn't give decent results it may not be trivial to
determine whether it is the JMeter host that can't handle the workload or
the system under test. Generally start at a load (number of threads) that
both JMeter and the system under test can handle and gives good results.
Then gradually work up to the target load, observing the behaviour of the
JMeter host and the system under test. Then when the run breaks you'll have
an idea of where it broke.




Ian Blavins
Contract Performance Engineer
Temenos

-----Original Message-----
From: Sonam Chauhan [mailto:sonam.chauhan@ce.com.au] 
Sent: 09 May 2007 07:46
To: JMeter Users List
Subject: maximum number of threads per JMeter instance

Hi -  

 

Can someone point me to documentation on the maximum number of threads a
single JMeter instance can handle? (I cannot find this information on
Google or the wiki.) 

 

I have a problem with a testcase that has a large number of threads - it
has 2 thread groups with 2000 and 5000 threads each. On a Windows XP SP2
system with 2GB of RAM, java.exe grows to about 350MB before throwing
this exception: 

-------------------------

Exception in thread "Thread-1" java.lang.OutOfMemoryError: unable to
create new native thread

        at java.lang.Thread.start0(Native Method)

        at java.lang.Thread.start(Thread.java:574)

        at
org.apache.jmeter.engine.StandardJMeterEngine.run(StandardJMeterEngine.j
ava:387)

        at java.lang.Thread.run(Thread.java:595)

-------------------------

 

The JMeter version is 2.1.1 and the Java version is "1.5.0_10"

-------------------------

Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_10-b03)

Java HotSpot(TM) Client VM (build 1.5.0_10-b03, mixed mode)

-------------------------

 

I tried tweaking two JMeter run script settings: HEAP and NEW. I started
small, and increased the numbers proportionally up until Xmx=1024m but
it was little use - the more I increased HEAP size, the faster I got the
outOfMemory errors. 

 

I also came across some interesting information here about the maximum
number of threads per process: 

 
http://blogs.msdn.com/oldnewthing/archive/2005/07/29/444912.aspx 

I tried using '-Xss128k' to reduce stack size per Java thread, but that
did not help either. 

 

Kind regards,

Sonam Chauhan

-- 

Corporate Express Australia Ltd. 

Phone: +61-2-93350725, Email: sonam.chauhan@ce.com.au

 




This email (and any attachments) contains confidential information, and is intended 
only for the named recipient. Distribution or copying of this email by anyone 
other than the named recipient is prohibited. If you are not the named or 
intended recipient, please notify TEMENOS or the sender immediately and 
permanently destroy this email (and any attachments) and all copies of it. No 
member of TEMENOS Group AG or any of its associated or affiliated companies is 
liable for any errors or omissions in the content or transmission of this 
email. Any opinions contained in this email are solely those of the author and, 
unless clearly indicated otherwise in writing, are not endorsed by any member 
of TEMENOS Group AG or any of its associated and affiliated companies. 


---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org