You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by mjara <ma...@hotmail.com> on 2012/03/03 13:17:29 UTC

Constant Throughput Timer and test duration conflict

I have a test plan with two thread groups. Each thread group has an HTTP
sampler and each HTTP sampler has a constant throughput timer (CTP). Each
thread group has 5 threads. If I set the test duration in each thread group
to 10 seconds and set CTP to 60 (1 request per second) then the test ends
after 10 seconds as expected. 

However, if I set the CTP to 1 (1 request per minute) then the test does not
end after 10 seconds. It runs for a long time. 

This is a simplified version of what I'm actually trying to accomplish. My
real test plan has 120 thread groups. Each thread group has a different
required throughput and some needs many requests per minute and some just
need 1.

I suspect the threads are being delayed to achieve the required throughput,
however, I think that when the test is completed based on the test duration
value, then all threads should shutdown no matter what state they are in. 

--
View this message in context: http://jmeter.512774.n5.nabble.com/Constant-Throughput-Timer-and-test-duration-conflict-tp5533559p5533559.html
Sent from the JMeter - User mailing list archive at Nabble.com.

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


Re: Constant Throughput Timer and test duration conflict

Posted by Flavio Cysne <fl...@gmail.com>.
Just to know if my thoughts is on the right way, for this case.
If you put a delay after your HTTP Sampler with a dynamic delay timing,
considering you could use a post-processor to, say, calculate time spent on
the request and set the delay time to (60000 - SpentTime). This way you'll
have your 1 request per minute requirement. Configure the loop count Test
Plan field and *voila*.

Other way is using Ramp up to distribute your request in a pre-defined time
period between each request (easier to configure IMO).

Don't know if it'll be possible, but, IMO, ideas are always welcome.

Hope it helps you.
Flávio Cysne

2012/3/12 Marcelo Jara <ma...@hotmail.com>

>
> Well, iteration count is only used for debugging or when creating new
> samplers only. I would gladly share my test plan with you if you want to
> look at it. I already posted the requirements for the test. This system has
> over a dozen consumers and exposes over 120 services. So each service must
> be hit independently which is why a separate thread group is needed for
> each sampler.  This is my first jmeter test plan and I don't doubt that I
> may be doing something fundamentally wrong.
>
> > Date: Sat, 10 Mar 2012 22:57:54 -0800
> > From: apc@apc.kg
> > To: jmeter-user@jakarta.apache.org
> > Subject: Re: Constant Throughput Timer and test duration conflict
> >
> > If you operate with fixed test duration, then iteration count makes no
> sense,
> > because the same test duration may include different iterations,
> depending
> > on server response time.
> > Well, all I hear about your case tells me that there's something may be
> > inefficient in your approach.
> > Maybe you should choose stress-test mode as your primary performance
> > criteria. Just my opinion.
> >
> > -----
> > --
> > Andrey Pohilko
> > JP@GC Maintainer
> > --
> > View this message in context:
> http://jmeter.512774.n5.nabble.com/Constant-Throughput-Timer-and-test-duration-conflict-tp5533559p5554206.html
> > Sent from the JMeter - User mailing list archive at Nabble.com.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> > For additional commands, e-mail: user-help@jmeter.apache.org
> >
>
>

RE: Constant Throughput Timer and test duration conflict

Posted by Marcelo Jara <ma...@hotmail.com>.
Well, iteration count is only used for debugging or when creating new samplers only. I would gladly share my test plan with you if you want to look at it. I already posted the requirements for the test. This system has over a dozen consumers and exposes over 120 services. So each service must be hit independently which is why a separate thread group is needed for each sampler.  This is my first jmeter test plan and I don't doubt that I may be doing something fundamentally wrong. 

> Date: Sat, 10 Mar 2012 22:57:54 -0800
> From: apc@apc.kg
> To: jmeter-user@jakarta.apache.org
> Subject: Re: Constant Throughput Timer and test duration conflict
> 
> If you operate with fixed test duration, then iteration count makes no sense,
> because the same test duration may include different iterations, depending
> on server response time.
> Well, all I hear about your case tells me that there's something may be
> inefficient in your approach.
> Maybe you should choose stress-test mode as your primary performance
> criteria. Just my opinion.
> 
> -----
> --
> Andrey Pohilko
> JP@GC Maintainer
> --
> View this message in context: http://jmeter.512774.n5.nabble.com/Constant-Throughput-Timer-and-test-duration-conflict-tp5533559p5554206.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
> 
 		 	   		  

Re: Constant Throughput Timer and test duration conflict

Posted by apc <ap...@apc.kg>.
If you operate with fixed test duration, then iteration count makes no sense,
because the same test duration may include different iterations, depending
on server response time.
Well, all I hear about your case tells me that there's something may be
inefficient in your approach.
Maybe you should choose stress-test mode as your primary performance
criteria. Just my opinion.

-----
--
Andrey Pohilko
JP@GC Maintainer
--
View this message in context: http://jmeter.512774.n5.nabble.com/Constant-Throughput-Timer-and-test-duration-conflict-tp5533559p5554206.html
Sent from the JMeter - User mailing list archive at Nabble.com.

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


Re: Constant Throughput Timer and test duration conflict

Posted by mjara <ma...@hotmail.com>.
Thanks for the suggestion. I'll need to wait until issue 115 (allowing
floating point numbers) is implemented before I use it. Many of the samplers
I have require a throghput of 1 request per minute (or less). 

Also, if I'm using an iteration count for the thread group, how do I tell
the Throughput Shaping Timer to run at a specific rate for the entire test?

--
View this message in context: http://jmeter.512774.n5.nabble.com/Constant-Throughput-Timer-and-test-duration-conflict-tp5533559p5554159.html
Sent from the JMeter - User mailing list archive at Nabble.com.

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


Re: Constant Throughput Timer and test duration conflict

Posted by apc <ap...@apc.kg>.
http://code.google.com/p/jmeter-plugins/wiki/ThroughputShapingTimer can give
you control over throughput and shuts test down when schedule end reached.

-----
--
Andrey Pohilko
JP@GC Maintainer
--
View this message in context: http://jmeter.512774.n5.nabble.com/Constant-Throughput-Timer-and-test-duration-conflict-tp5533559p5552613.html
Sent from the JMeter - User mailing list archive at Nabble.com.

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


Re: Constant Throughput Timer and test duration conflict

Posted by mjara <ma...@hotmail.com>.
Any help would be greatly appreciated. 

--
View this message in context: http://jmeter.512774.n5.nabble.com/Constant-Throughput-Timer-and-test-duration-conflict-tp5533559p5551974.html
Sent from the JMeter - User mailing list archive at Nabble.com.

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


Re: Constant Throughput Timer and test duration conflict

Posted by mjara <ma...@hotmail.com>.
Thanks Sebb-2-2,

What I gave was just an example. My real tests are much longer ( > 1hr). We
cannot use a single thread group because we can't let the response time of
one sampler affect the throughput of the other. Here are the basic
requirements of what I'm being asked to do.

1) Run a test against 120 services which live on one server. These are
RESTful web services. Some use xml, some us json. Some requests are GETs,
while others are POSTs. 

2) Simulate production load and distribution for each of the services. This
is very important. We need to keep a steady state of a particular throughput
for each service. 

What I've tried to do is make each sampler independent from each other by
putting them in their own thread group. I then put a CTP in each thread
group so that I can control the throughput of each service request. 

The tricky part is determining the number of threads to assign to each
thread group, since some samplers may require more threads to achieve the
required throughput. Currently the test plan has all the thread groups using
a variable for the # of threads. 


If there is a better way to do this, let me know. I've just started playing
around with jmeter a few months ago. An option to shutdown the test when the
test duration time is met would help a lot and not affect other test plans. 








--
View this message in context: http://jmeter.512774.n5.nabble.com/Constant-Throughput-Timer-and-test-duration-conflict-tp5533559p5538131.html
Sent from the JMeter - User mailing list archive at Nabble.com.

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


Re: Constant Throughput Timer and test duration conflict

Posted by sebb <se...@gmail.com>.
On 3 March 2012 12:17, mjara <ma...@hotmail.com> wrote:
> I have a test plan with two thread groups. Each thread group has an HTTP
> sampler and each HTTP sampler has a constant throughput timer (CTP). Each

Don't use multiple CTP elements; one per thread should be enough.

> thread group has 5 threads. If I set the test duration in each thread group
> to 10 seconds and set CTP to 60 (1 request per second) then the test ends
> after 10 seconds as expected.

10 seconds is too short for a useful test run.

> However, if I set the CTP to 1 (1 request per minute) then the test does not
> end after 10 seconds. It runs for a long time.
>
> This is a simplified version of what I'm actually trying to accomplish. My
> real test plan has 120 thread groups. Each thread group has a different
> required throughput and some needs many requests per minute and some just
> need 1.

You should probably consider rearranging the test plan to use a single
thread group with the appropriate proportions of samplers.

> I suspect the threads are being delayed to achieve the required throughput,

Yes, necessarily.

> however, I think that when the test is completed based on the test duration
> value, then all threads should shutdown no matter what state they are in.

That does not happen currently.

Neither timers nor samplers are interrupted by the expiry of the test
duration; this cannot be changed without affecting existing test
plans.

> --
> View this message in context: http://jmeter.512774.n5.nabble.com/Constant-Throughput-Timer-and-test-duration-conflict-tp5533559p5533559.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>

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