Discussion:
Loop Count vs Number of Threads
cal0y
2010-11-19 10:49:32 UTC
Permalink
Good day,

I have 10 accounts to use in load testing our application. I just want to
know if my Jmeter test will behave in the same manner if:

1. If i put 100 in the number of threads and a loop count of 1
2. If i put 10 in the number of threads and loop count of 10

Thanks!
--
View this message in context: http://jmeter.512774.n5.nabble.com/Loop-Count-vs-Number-of-Threads-tp3272154p3272154.html
Sent from the JMeter - User mailing list archive at Nabble.com.
Felix Frank
2010-11-19 10:58:11 UTC
Permalink
Post by cal0y
Good day,
I have 10 accounts to use in load testing our application. I just want to
1. If i put 100 in the number of threads and a loop count of 1
2. If i put 10 in the number of threads and loop count of 10
Assuming you use a UserDefinedVariables element with the 10 accounts
each as a variable value, the two approaches you outline should indeed
reuse the accounts and behave functionally equivalently.

However, when using 100 threads, each accout will be active in 10
simultaneous incarnations, whereas when looping, each does 10
consecutive runs (is this understandable?)

Cheers,
Felix
chaitanya bhatt
2010-11-19 11:14:21 UTC
Permalink
If you are creating 100 threads with zero latency in the ramp up you will
have more than 20-30 http connection threads created in the server, plus the
concurrency would be very high causing your Database and Application
resources to be locked and/or access to be queued.

Whereas 10 threads with 10 iterations each would have lesser number of
connections or threads on the web/app/db server because of lesser
concurrency and the chances of resource contention (i,e locks) would be
less.

There is huge difference between these two types of tests. Your should
consult your client and find out what type of test they want before your
proceed.

-Chaitanya M Bhatt
http://www.performancecompetence.com
Post by cal0y
Good day,
I have 10 accounts to use in load testing our application. I just want to
1. If i put 100 in the number of threads and a loop count of 1
2. If i put 10 in the number of threads and loop count of 10
Thanks!
--
http://jmeter.512774.n5.nabble.com/Loop-Count-vs-Number-of-Threads-tp3272154p3272154.html
Sent from the JMeter - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
cal0y
2010-11-19 11:38:06 UTC
Permalink
If they have the same ramp up time of 100 seconds, will they behave the same?
--
View this message in context: http://jmeter.512774.n5.nabble.com/Loop-Count-vs-Number-of-Threads-tp3272154p3272187.html
Sent from the JMeter - User mailing list archive at Nabble.com.
Felix Frank
2010-11-19 11:39:42 UTC
Permalink
Post by cal0y
If they have the same ramp up time of 100 seconds, will they behave the same?
No. Why would they?

100 threads w. Rampup 100secs: 1 Thread launched per second
10 threads w. Rampup 100secs: 1 Thread launched each 10 seconds
cal0y
2010-11-19 11:53:02 UTC
Permalink
Sorry, My Mistake. What i meant was:

1. 10 threads, 100secs ramp up, loop count of 10
2. 100 threads, 1000secs ramp up

Thanks.
--
View this message in context: http://jmeter.512774.n5.nabble.com/Loop-Count-vs-Number-of-Threads-tp3272154p3272195.html
Sent from the JMeter - User mailing list archive at Nabble.com.
Felix Frank
2010-11-19 11:56:07 UTC
Permalink
Post by cal0y
1. 10 threads, 100secs ramp up, loop count of 10
2. 100 threads, 1000secs ramp up
Thanks.
That's different as well:

(1) after 100 seconds, you have 10 simultaneous threads and that's it
(2) after 100 seconds, you have 10 threads as well, but the load keeps
rising, and after 1000 seconds, you have the full crushing load of 100
threads.

What is the problem you are trying to solve, anyway? Maybe we could give
better advice when knowing some context.
cal0y
2010-11-19 12:40:01 UTC
Permalink
The first scenario has a loop count of 10, wouldn't that also load 100
threads to the server?

Anyway, my real problem is this:

I use a csv file for the test plan with a format like this:
usernameA,PasswordA,DataA
usernameB,PasswordB,DataB
usernameC,PasswordB,DataC
.
.
usernameJ,PasswordJ,DataC

When i use the 1st scenario where i loop the test plan, there are instances
where a thread used usernameA, PasswordA, but used DataC. I don't seem to
have this problem when i just increase the number of threads and increase
the ramp up time.

Is there something wrong about the way i used the csv file?

Thanks
--
View this message in context: http://jmeter.512774.n5.nabble.com/Loop-Count-vs-Number-of-Threads-tp3272154p3272238.html
Sent from the JMeter - User mailing list archive at Nabble.com.
Deepak Shetty
2010-11-19 12:47:41 UTC
Permalink
Post by cal0y
The first scenario has a loop count of 10, wouldn't that also load 100
No . The number of threads in the threadgroup is the maximum number of
connections the server will see at any point. The loop simply iterates but
at any given time not more than 10 requests will be made in parallel.
Post by cal0y
there are instances where a thread used usernameA, PasswordA, but used
DataC
Can you print out using a debug sampler + view results tree? Im assuming you
are using a CSV data set config

regards
deepak
Post by cal0y
The first scenario has a loop count of 10, wouldn't that also load 100
threads to the server?
usernameA,PasswordA,DataA
usernameB,PasswordB,DataB
usernameC,PasswordB,DataC
.
.
usernameJ,PasswordJ,DataC
When i use the 1st scenario where i loop the test plan, there are instances
where a thread used usernameA, PasswordA, but used DataC. I don't seem to
have this problem when i just increase the number of threads and increase
the ramp up time.
Is there something wrong about the way i used the csv file?
Thanks
--
http://jmeter.512774.n5.nabble.com/Loop-Count-vs-Number-of-Threads-tp3272154p3272238.html
Sent from the JMeter - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
guru
2013-08-13 23:03:04 UTC
Permalink
I have question regarding loop.. and wondering if anyone could help me out.

Thread group: 250
ramp up: 450
loop: 1

I get no error.

Thread group: 250
ramp up:450
loop:2

I get error

Thread group: 250
ramp up: 450
loop:3

I get error


Thread group: 10
ramp up: 1
loop: 1

No error

Thread group: 10
ramp up: 1
loop: 5

I get error


I am testing SSO login, and our application do not allow user to login in
twice. user has to logout.

In my test i have a request for login and logout..

I am reading 250 different users from a file.

But when I have loop, these users are repeated.

My question is when I have loop count = 2 or 3. Do all the loop get started
same time or does 2nd loop starts only after the first loop has completed.

I have a feeling this error has to do with loop since i am not getting error
in loop count 1. But I do not understand why it is giving me error when loop
count is 2 or more. When I have logout request and as well as clear cookies
each iteration.





--
View this message in context: http://jmeter.512774.n5.nabble.com/Loop-Count-vs-Number-of-Threads-tp3272154p5717838.html
Sent from the JMeter - User mailing list archive at Nabble.com.
umesh prajapati
2013-08-13 23:11:59 UTC
Permalink
My second thought is, if loop is not the issue, is jmeter cookie killer not
clearing my cookies session each iteration??
Post by guru
I have question regarding loop.. and wondering if anyone could help me out.
Thread group: 250
ramp up: 450
loop: 1
I get no error.
Thread group: 250
ramp up:450
loop:2
I get error
Thread group: 250
ramp up: 450
loop:3
I get error
Thread group: 10
ramp up: 1
loop: 1
No error
Thread group: 10
ramp up: 1
loop: 5
I get error
I am testing SSO login, and our application do not allow user to login in
twice. user has to logout.
In my test i have a request for login and logout..
I am reading 250 different users from a file.
But when I have loop, these users are repeated.
My question is when I have loop count = 2 or 3. Do all the loop get started
same time or does 2nd loop starts only after the first loop has completed.
I have a feeling this error has to do with loop since i am not getting error
in loop count 1. But I do not understand why it is giving me error when loop
count is 2 or more. When I have logout request and as well as clear cookies
each iteration.
--
http://jmeter.512774.n5.nabble.com/Loop-Count-vs-Number-of-Threads-tp3272154p5717838.html
Sent from the JMeter - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
Manish Sapariya
2013-08-14 09:13:16 UTC
Permalink
Does following configuration work?

Thread group: 1
ramp up: 1
loop: 2

Thanks and Regards,
Manish
kPoint wins *Global eLearning
Award<http://www.kpoint.com/kpoint-wins-learntech-global-e-learning-award/>
* in “Learning Technologies Solution”!
Post by umesh prajapati
My second thought is, if loop is not the issue, is jmeter cookie killer not
clearing my cookies session each iteration??
Post by guru
I have question regarding loop.. and wondering if anyone could help me
out.
Post by guru
Thread group: 250
ramp up: 450
loop: 1
I get no error.
Thread group: 250
ramp up:450
loop:2
I get error
Thread group: 250
ramp up: 450
loop:3
I get error
Thread group: 10
ramp up: 1
loop: 1
No error
Thread group: 10
ramp up: 1
loop: 5
I get error
I am testing SSO login, and our application do not allow user to login in
twice. user has to logout.
In my test i have a request for login and logout..
I am reading 250 different users from a file.
But when I have loop, these users are repeated.
My question is when I have loop count = 2 or 3. Do all the loop get
started
Post by guru
same time or does 2nd loop starts only after the first loop has
completed.
Post by guru
I have a feeling this error has to do with loop since i am not getting error
in loop count 1. But I do not understand why it is giving me error when loop
count is 2 or more. When I have logout request and as well as clear
cookies
Post by guru
each iteration.
--
http://jmeter.512774.n5.nabble.com/Loop-Count-vs-Number-of-Threads-tp3272154p5717838.html
Post by guru
Sent from the JMeter - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
Flavio Cysne
2013-08-14 12:25:44 UTC
Permalink
Just test it here with JMeter 2.9.

Threads Group (threads: 5, rampup: 0, loop: 3)
- Debug sampler
- Gaussian Random Timer (deviation: 400, offset: 600)

Thread Group 1-1 started after Thread Group 1-5 second execution

Loop count is for each thread not for all threads together.

In your case, if you want to all threads start together for each loop
you'll have to use a different approach:

Synchronizing Timer using all threads
and to simulate rampup you can use a Constant Timer with this expression:
${__javaScript(${__threadNum()}*300)}
where 300 is the time gap between two threads to start.
with this the first thread will start at 300ms from test start, second at
600ms, third at 900ms, and so on

If you need to use distributed testing with this approach you'll have to
define a system property for every server (or using a property defined in
command line) with distinct values.
For example, if you have 5 machines, the first machine you'll define a
system property called custom.machine.index=1, second machine will have a
value of 2, and so on.
Constant timer expression will change slightly:
${__javaScript(${__threadNum()}*${__P(custom.machine.index,1)}*300)}

Hope it helps you.
Post by Manish Sapariya
Does following configuration work?
Thread group: 1
ramp up: 1
loop: 2
Thanks and Regards,
Manish
kPoint wins *Global eLearning
Award<http://www.kpoint.com/kpoint-wins-learntech-global-e-learning-award/
* in “Learning Technologies Solution”!
Post by umesh prajapati
My second thought is, if loop is not the issue, is jmeter cookie killer
not
Post by umesh prajapati
clearing my cookies session each iteration??
Post by guru
I have question regarding loop.. and wondering if anyone could help me
out.
Post by guru
Thread group: 250
ramp up: 450
loop: 1
I get no error.
Thread group: 250
ramp up:450
loop:2
I get error
Thread group: 250
ramp up: 450
loop:3
I get error
Thread group: 10
ramp up: 1
loop: 1
No error
Thread group: 10
ramp up: 1
loop: 5
I get error
I am testing SSO login, and our application do not allow user to login
in
Post by umesh prajapati
Post by guru
twice. user has to logout.
In my test i have a request for login and logout..
I am reading 250 different users from a file.
But when I have loop, these users are repeated.
My question is when I have loop count = 2 or 3. Do all the loop get
started
Post by guru
same time or does 2nd loop starts only after the first loop has
completed.
Post by guru
I have a feeling this error has to do with loop since i am not getting error
in loop count 1. But I do not understand why it is giving me error when loop
count is 2 or more. When I have logout request and as well as clear
cookies
Post by guru
each iteration.
--
http://jmeter.512774.n5.nabble.com/Loop-Count-vs-Number-of-Threads-tp3272154p5717838.html
Post by umesh prajapati
Post by guru
Sent from the JMeter - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
umesh prajapati
2013-08-14 15:13:16 UTC
Permalink
when I meant by error, i have assertion on my jmeter test plan. Since it
didnt meet assertion it failed.

@Manish yes that configuration worked when i tried it .

But lets say when i have 250 students and I would like 2000 students to
login in 1 hr. So, basically in 1 minute 33 users login.

Thread group :250
ramp up: 450
loop: 1

If i run the test in this configureation, all the assertion that i have
pass and it shows no error. But If i would like to run this test longer
and I increase the number of loops.


Thread Group: 250
ramp up: 450
loop:3

Now, the assertions that i have do not pass and it shows errror.

I know in my application, one user is not allowed to login multiple times
until the session thats logged in is logged out.

so, I am wondering, when I have loop 3. Does all the loop starts at once?
if so than that is causing my assertion to fail and giving error.

@Flavio I dont need to start all my thread at once, But I would like to
test the real scenario, where 2000 users login in 2 hrs. So, basically 1
min 33 users.
Post by Flavio Cysne
Just test it here with JMeter 2.9.
Threads Group (threads: 5, rampup: 0, loop: 3)
- Debug sampler
- Gaussian Random Timer (deviation: 400, offset: 600)
Thread Group 1-1 started after Thread Group 1-5 second execution
Loop count is for each thread not for all threads together.
In your case, if you want to all threads start together for each loop
Synchronizing Timer using all threads
${__javaScript(${__threadNum()}*300)}
where 300 is the time gap between two threads to start.
with this the first thread will start at 300ms from test start, second at
600ms, third at 900ms, and so on
If you need to use distributed testing with this approach you'll have to
define a system property for every server (or using a property defined in
command line) with distinct values.
For example, if you have 5 machines, the first machine you'll define a
system property called custom.machine.index=1, second machine will have a
value of 2, and so on.
${__javaScript(${__threadNum()}*${__P(custom.machine.index,1)}*300)}
Hope it helps you.
Post by Manish Sapariya
Does following configuration work?
Thread group: 1
ramp up: 1
loop: 2
Thanks and Regards,
Manish
kPoint wins *Global eLearning
Award<
http://www.kpoint.com/kpoint-wins-learntech-global-e-learning-award/
Post by Manish Sapariya
* in “Learning Technologies Solution”!
Post by umesh prajapati
My second thought is, if loop is not the issue, is jmeter cookie killer
not
Post by umesh prajapati
clearing my cookies session each iteration??
Post by guru
I have question regarding loop.. and wondering if anyone could help
me
Post by Manish Sapariya
Post by umesh prajapati
out.
Post by guru
Thread group: 250
ramp up: 450
loop: 1
I get no error.
Thread group: 250
ramp up:450
loop:2
I get error
Thread group: 250
ramp up: 450
loop:3
I get error
Thread group: 10
ramp up: 1
loop: 1
No error
Thread group: 10
ramp up: 1
loop: 5
I get error
I am testing SSO login, and our application do not allow user to
login
Post by Manish Sapariya
in
Post by umesh prajapati
Post by guru
twice. user has to logout.
In my test i have a request for login and logout..
I am reading 250 different users from a file.
But when I have loop, these users are repeated.
My question is when I have loop count = 2 or 3. Do all the loop get
started
Post by guru
same time or does 2nd loop starts only after the first loop has
completed.
Post by guru
I have a feeling this error has to do with loop since i am not
getting
Post by Manish Sapariya
Post by umesh prajapati
Post by guru
error
in loop count 1. But I do not understand why it is giving me error
when
Post by Manish Sapariya
Post by umesh prajapati
Post by guru
loop
count is 2 or more. When I have logout request and as well as clear
cookies
Post by guru
each iteration.
--
http://jmeter.512774.n5.nabble.com/Loop-Count-vs-Number-of-Threads-tp3272154p5717838.html
Post by Manish Sapariya
Post by umesh prajapati
Post by guru
Sent from the JMeter - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
Flavio Cysne
2013-08-14 15:35:51 UTC
Permalink
I think you misunderstood me.

"I know in my application, one user is not allowed to login multiple
times until
the session thats logged in is logged out."

Loop 2 threads can't start until all Loop 1 threads are over. Synchronizing
Timer with "Number of simulated users" equal to the number of threads will
ensure this.

"@Flavio I dont need to start all my thread at once,..."

That's why I suggest you to use a Constant timer with an expression.

"...But I would like to test the real scenario, where 2000 users login in 2
hrs. So, basically 1 min 33 users."

Modify that 300 in Constant Timer expression for the value equivalent to
time gap for 33 users within 1 minute. (60000ms / 33 users = ~1818ms/user)

Regards
umesh prajapati
2013-08-14 16:25:38 UTC
Permalink
@ flavio Thanks ...will try it out and let you know the result.
Post by Flavio Cysne
I think you misunderstood me.
"I know in my application, one user is not allowed to login multiple
times until
the session thats logged in is logged out."
Loop 2 threads can't start until all Loop 1 threads are over. Synchronizing
Timer with "Number of simulated users" equal to the number of threads will
ensure this.
That's why I suggest you to use a Constant timer with an expression.
"...But I would like to test the real scenario, where 2000 users login in 2
hrs. So, basically 1 min 33 users."
Modify that 300 in Constant Timer expression for the value equivalent to
time gap for 33 users within 1 minute. (60000ms / 33 users = ~1818ms/user)
Regards
umesh prajapati
2013-08-14 17:23:07 UTC
Permalink
one quick question do i add the timer on thread group or the http reques
sampler
Post by umesh prajapati
@ flavio Thanks ...will try it out and let you know the result.
Post by Flavio Cysne
I think you misunderstood me.
"I know in my application, one user is not allowed to login multiple
times until
the session thats logged in is logged out."
Loop 2 threads can't start until all Loop 1 threads are over.
Synchronizing
Timer with "Number of simulated users" equal to the number of threads will
ensure this.
That's why I suggest you to use a Constant timer with an expression.
"...But I would like to test the real scenario, where 2000 users login in 2
hrs. So, basically 1 min 33 users."
Modify that 300 in Constant Timer expression for the value equivalent to
time gap for 33 users within 1 minute. (60000ms / 33 users = ~1818ms/user)
Regards
Flavio Cysne
2013-08-14 19:49:34 UTC
Permalink
only in the first http sampler
Post by umesh prajapati
one quick question do i add the timer on thread group or the http reques
sampler
Post by umesh prajapati
@ flavio Thanks ...will try it out and let you know the result.
Post by Flavio Cysne
I think you misunderstood me.
"I know in my application, one user is not allowed to login multiple
times until
the session thats logged in is logged out."
Loop 2 threads can't start until all Loop 1 threads are over. Synchronizing
Timer with "Number of simulated users" equal to the number of threads
will
Post by umesh prajapati
Post by Flavio Cysne
ensure this.
That's why I suggest you to use a Constant timer with an expression.
"...But I would like to test the real scenario, where 2000 users login
in
Post by umesh prajapati
Post by Flavio Cysne
2
hrs. So, basically 1 min 33 users."
Modify that 300 in Constant Timer expression for the value equivalent to
time gap for 33 users within 1 minute. (60000ms / 33 users =
~1818ms/user)
Post by umesh prajapati
Post by Flavio Cysne
Regards
umesh prajapati
2013-08-15 13:08:11 UTC
Permalink
If I put the timer, than it means 2nd request has to wait until the first
request is complete. This means if first request is taking time to process
the request than 2nd request will not start until the first request is
completed. Which means there won't be a load but I am doing a load test.
Post by Flavio Cysne
only in the first http sampler
Post by umesh prajapati
one quick question do i add the timer on thread group or the http reques
sampler
Post by umesh prajapati
@ flavio Thanks ...will try it out and let you know the result.
Post by Flavio Cysne
I think you misunderstood me.
"I know in my application, one user is not allowed to login multiple
times until
the session thats logged in is logged out."
Loop 2 threads can't start until all Loop 1 threads are over. Synchronizing
Timer with "Number of simulated users" equal to the number of threads
will
Post by umesh prajapati
Post by Flavio Cysne
ensure this.
That's why I suggest you to use a Constant timer with an expression.
"...But I would like to test the real scenario, where 2000 users login
in
Post by umesh prajapati
Post by Flavio Cysne
2
hrs. So, basically 1 min 33 users."
Modify that 300 in Constant Timer expression for the value equivalent
to
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
time gap for 33 users within 1 minute. (60000ms / 33 users =
~1818ms/user)
Post by umesh prajapati
Post by Flavio Cysne
Regards
Flavio Cysne
2013-08-16 11:50:25 UTC
Permalink
No. The Constant Timer is the delay between the start of one thread to the
start of the next thread. No relation among threads execution time at all.
So if thread 1 starts and take 1 second to complete, and Constant Timer has
300ms delay, then the second thread will start before 1st thread ends.

Ramp-up also put this delay in your threads, the same way constant timer
will do. If you want to leverage concurrency remove the timer.
Post by umesh prajapati
If I put the timer, than it means 2nd request has to wait until the first
request is complete. This means if first request is taking time to process
the request than 2nd request will not start until the first request is
completed. Which means there won't be a load but I am doing a load test.
Post by Flavio Cysne
only in the first http sampler
Post by umesh prajapati
one quick question do i add the timer on thread group or the http
reques
Post by Flavio Cysne
Post by umesh prajapati
sampler
Post by umesh prajapati
@ flavio Thanks ...will try it out and let you know the result.
Post by Flavio Cysne
I think you misunderstood me.
"I know in my application, one user is not allowed to login multiple
times until
the session thats logged in is logged out."
Loop 2 threads can't start until all Loop 1 threads are over. Synchronizing
Timer with "Number of simulated users" equal to the number of
threads
Post by Flavio Cysne
Post by umesh prajapati
will
Post by umesh prajapati
Post by Flavio Cysne
ensure this.
That's why I suggest you to use a Constant timer with an expression.
"...But I would like to test the real scenario, where 2000 users
login
Post by Flavio Cysne
Post by umesh prajapati
in
Post by umesh prajapati
Post by Flavio Cysne
2
hrs. So, basically 1 min 33 users."
Modify that 300 in Constant Timer expression for the value
equivalent
Post by Flavio Cysne
to
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
time gap for 33 users within 1 minute. (60000ms / 33 users =
~1818ms/user)
Post by umesh prajapati
Post by Flavio Cysne
Regards
umesh prajapati
2013-08-16 13:51:56 UTC
Permalink
Thank you but I am still confused. So you mean constant time also does the
same job like ramp-up period. Lets say I have following configuration

Number of threads : 250
Ramp up period : 450
Loop : 3
From what I have understood about rampup. It takes 450 seconds to complete
250 threads. So the delay between thread 1 and thread 2 is 450/250 seconds.

So if I also add constant timer to this configuration lets say (450/250)
seconds. I don't get why do we need constant timer when ramp up is doing
the same thing.
No. The Constant Timer is the delay between the start of one thread to the
start of the next thread. No relation among threads execution time at all.
So if thread 1 starts and take 1 second to complete, and Constant Timer has
300ms delay, then the second thread will start before 1st thread ends.
Ramp-up also put this delay in your threads, the same way constant timer
will do. If you want to leverage concurrency remove the timer.
Post by umesh prajapati
If I put the timer, than it means 2nd request has to wait until the first
request is complete. This means if first request is taking time to
process
Post by umesh prajapati
the request than 2nd request will not start until the first request is
completed. Which means there won't be a load but I am doing a load test.
Post by Flavio Cysne
only in the first http sampler
Post by umesh prajapati
one quick question do i add the timer on thread group or the http
reques
Post by Flavio Cysne
Post by umesh prajapati
sampler
On Wed, Aug 14, 2013 at 9:25 AM, umesh prajapati <
Post by umesh prajapati
@ flavio Thanks ...will try it out and let you know the result.
On Wed, Aug 14, 2013 at 8:35 AM, Flavio Cysne <
Post by Flavio Cysne
I think you misunderstood me.
"I know in my application, one user is not allowed to login
multiple
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
times until
the session thats logged in is logged out."
Loop 2 threads can't start until all Loop 1 threads are over.
Synchronizing
Timer with "Number of simulated users" equal to the number of
threads
Post by Flavio Cysne
Post by umesh prajapati
will
Post by umesh prajapati
Post by Flavio Cysne
ensure this.
That's why I suggest you to use a Constant timer with an
expression.
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
"...But I would like to test the real scenario, where 2000 users
login
Post by Flavio Cysne
Post by umesh prajapati
in
Post by umesh prajapati
Post by Flavio Cysne
2
hrs. So, basically 1 min 33 users."
Modify that 300 in Constant Timer expression for the value
equivalent
Post by Flavio Cysne
to
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
time gap for 33 users within 1 minute. (60000ms / 33 users =
~1818ms/user)
Post by umesh prajapati
Post by Flavio Cysne
Regards
Flavio Cysne
2013-08-16 14:18:27 UTC
Permalink
When you use Synchronizing Timer all the threads will start at the same
time, when the number of threads started reaches the configured value.
In your test plan Ramp-up will delay the start of the threads, but next
loop execution will break down your test, as you have stated.
Then Constant Timer is used to overcome this issue, delaying the start time
of the threads as ramp-up does, but not messing thing up after the first
loop.
BTW, your script Threads Group Ramp-up have to be 0 (zero).
Post by umesh prajapati
Thank you but I am still confused. So you mean constant time also does the
same job like ramp-up period. Lets say I have following configuration
Number of threads : 250
Ramp up period : 450
Loop : 3
From what I have understood about rampup. It takes 450 seconds to complete
250 threads. So the delay between thread 1 and thread 2 is 450/250 seconds.
So if I also add constant timer to this configuration lets say (450/250)
seconds. I don't get why do we need constant timer when ramp up is doing
the same thing.
Post by Flavio Cysne
No. The Constant Timer is the delay between the start of one thread to
the
Post by Flavio Cysne
start of the next thread. No relation among threads execution time at
all.
Post by Flavio Cysne
So if thread 1 starts and take 1 second to complete, and Constant Timer
has
Post by Flavio Cysne
300ms delay, then the second thread will start before 1st thread ends.
Ramp-up also put this delay in your threads, the same way constant timer
will do. If you want to leverage concurrency remove the timer.
Post by umesh prajapati
If I put the timer, than it means 2nd request has to wait until the
first
Post by Flavio Cysne
Post by umesh prajapati
request is complete. This means if first request is taking time to
process
Post by umesh prajapati
the request than 2nd request will not start until the first request is
completed. Which means there won't be a load but I am doing a load
test.
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
only in the first http sampler
Post by umesh prajapati
one quick question do i add the timer on thread group or the http
reques
Post by Flavio Cysne
Post by umesh prajapati
sampler
On Wed, Aug 14, 2013 at 9:25 AM, umesh prajapati <
Post by umesh prajapati
@ flavio Thanks ...will try it out and let you know the result.
On Wed, Aug 14, 2013 at 8:35 AM, Flavio Cysne <
Post by Flavio Cysne
I think you misunderstood me.
"I know in my application, one user is not allowed to login
multiple
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
times until
the session thats logged in is logged out."
Loop 2 threads can't start until all Loop 1 threads are over.
Synchronizing
Timer with "Number of simulated users" equal to the number of
threads
Post by Flavio Cysne
Post by umesh prajapati
will
Post by umesh prajapati
Post by Flavio Cysne
ensure this.
That's why I suggest you to use a Constant timer with an
expression.
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
"...But I would like to test the real scenario, where 2000 users
login
Post by Flavio Cysne
Post by umesh prajapati
in
Post by umesh prajapati
Post by Flavio Cysne
2
hrs. So, basically 1 min 33 users."
Modify that 300 in Constant Timer expression for the value
equivalent
Post by Flavio Cysne
to
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
time gap for 33 users within 1 minute. (60000ms / 33 users =
~1818ms/user)
Post by umesh prajapati
Post by Flavio Cysne
Regards
umesh prajapati
2013-08-16 14:39:38 UTC
Permalink
Thank you very much for making me understand what constant timer is. I see
you mentioned about synchronizing timer . So you have mentioned that
synchronizing timer will start all the threads at the same time. But in my
case, I would like 33 users to login in 1 minute. And lets say i have 250
users in my csv file but I would like to run my test for 2 hrs. And to
accomplish this I am increasing the number of loops. To complete one loop
lets say it takes 8 mins. so I will need around 15-16 loop counts.

Number of threads: 250
Ramo up: 0
Loop: 16

Constant timer to be added before http sampler : (60000/33) ms

So do I need synchronizing timer. Because if I do add synchronizing timer
it will start all 250 users at once (just to be clear when you say start
all at once) did you mean all 250 user login request will be sent at same
time.
Post by Flavio Cysne
When you use Synchronizing Timer all the threads will start at the same
time, when the number of threads started reaches the configured value.
In your test plan Ramp-up will delay the start of the threads, but next
loop execution will break down your test, as you have stated.
Then Constant Timer is used to overcome this issue, delaying the start time
of the threads as ramp-up does, but not messing thing up after the first
loop.
BTW, your script Threads Group Ramp-up have to be 0 (zero).
Post by umesh prajapati
Thank you but I am still confused. So you mean constant time also does
the
Post by umesh prajapati
same job like ramp-up period. Lets say I have following configuration
Number of threads : 250
Ramp up period : 450
Loop : 3
From what I have understood about rampup. It takes 450 seconds to
complete
Post by umesh prajapati
250 threads. So the delay between thread 1 and thread 2 is 450/250
seconds.
Post by umesh prajapati
So if I also add constant timer to this configuration lets say (450/250)
seconds. I don't get why do we need constant timer when ramp up is doing
the same thing.
Post by Flavio Cysne
No. The Constant Timer is the delay between the start of one thread to
the
Post by Flavio Cysne
start of the next thread. No relation among threads execution time at
all.
Post by Flavio Cysne
So if thread 1 starts and take 1 second to complete, and Constant Timer
has
Post by Flavio Cysne
300ms delay, then the second thread will start before 1st thread ends.
Ramp-up also put this delay in your threads, the same way constant
timer
Post by umesh prajapati
Post by Flavio Cysne
will do. If you want to leverage concurrency remove the timer.
Post by umesh prajapati
If I put the timer, than it means 2nd request has to wait until the
first
Post by Flavio Cysne
Post by umesh prajapati
request is complete. This means if first request is taking time to
process
Post by umesh prajapati
the request than 2nd request will not start until the first request
is
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
completed. Which means there won't be a load but I am doing a load
test.
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
only in the first http sampler
Post by umesh prajapati
one quick question do i add the timer on thread group or the http
reques
Post by Flavio Cysne
Post by umesh prajapati
sampler
On Wed, Aug 14, 2013 at 9:25 AM, umesh prajapati <
Post by umesh prajapati
@ flavio Thanks ...will try it out and let you know the result.
On Wed, Aug 14, 2013 at 8:35 AM, Flavio Cysne <
Post by Flavio Cysne
I think you misunderstood me.
"I know in my application, one user is not allowed to login
multiple
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
times until
the session thats logged in is logged out."
Loop 2 threads can't start until all Loop 1 threads are over.
Synchronizing
Timer with "Number of simulated users" equal to the number of
threads
Post by Flavio Cysne
Post by umesh prajapati
will
Post by umesh prajapati
Post by Flavio Cysne
ensure this.
That's why I suggest you to use a Constant timer with an
expression.
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
"...But I would like to test the real scenario, where 2000
users
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
login
Post by Flavio Cysne
Post by umesh prajapati
in
Post by umesh prajapati
Post by Flavio Cysne
2
hrs. So, basically 1 min 33 users."
Modify that 300 in Constant Timer expression for the value
equivalent
Post by Flavio Cysne
to
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
time gap for 33 users within 1 minute. (60000ms / 33 users =
~1818ms/user)
Post by umesh prajapati
Post by Flavio Cysne
Regards
Flavio Cysne
2013-08-16 15:07:58 UTC
Permalink
JMeter Test Plan will look like this:

Test Plan
- CSV Data Set Config (Recycle on EOF: True, Stop thread on EOF: false,
Sharing mode: All threads)
- Thread Group (threads: 250, rampup: 0, loop: 16)
- HTTP Request 1
- Synchronizing Timer (threads: 250)
- Constant Timer (delay: ${__javaScript(${__threadNum()}*1818)}
// 60000 / 33 = ~1818
- HTTP Request 2
...
- HTTP Request n
Post by umesh prajapati
Thank you very much for making me understand what constant timer is. I see
you mentioned about synchronizing timer . So you have mentioned that
synchronizing timer will start all the threads at the same time. But in my
case, I would like 33 users to login in 1 minute. And lets say i have 250
users in my csv file but I would like to run my test for 2 hrs. And to
accomplish this I am increasing the number of loops. To complete one loop
lets say it takes 8 mins. so I will need around 15-16 loop counts.
Number of threads: 250
Ramo up: 0
Loop: 16
Constant timer to be added before http sampler : (60000/33) ms
So do I need synchronizing timer. Because if I do add synchronizing timer
it will start all 250 users at once (just to be clear when you say start
all at once) did you mean all 250 user login request will be sent at same
time.
Post by Flavio Cysne
When you use Synchronizing Timer all the threads will start at the same
time, when the number of threads started reaches the configured value.
In your test plan Ramp-up will delay the start of the threads, but next
loop execution will break down your test, as you have stated.
Then Constant Timer is used to overcome this issue, delaying the start
time
Post by Flavio Cysne
of the threads as ramp-up does, but not messing thing up after the first
loop.
BTW, your script Threads Group Ramp-up have to be 0 (zero).
Post by umesh prajapati
Thank you but I am still confused. So you mean constant time also does
the
Post by umesh prajapati
same job like ramp-up period. Lets say I have following configuration
Number of threads : 250
Ramp up period : 450
Loop : 3
From what I have understood about rampup. It takes 450 seconds to
complete
Post by umesh prajapati
250 threads. So the delay between thread 1 and thread 2 is 450/250
seconds.
Post by umesh prajapati
So if I also add constant timer to this configuration lets say
(450/250)
Post by Flavio Cysne
Post by umesh prajapati
seconds. I don't get why do we need constant timer when ramp up is
doing
Post by Flavio Cysne
Post by umesh prajapati
the same thing.
Post by Flavio Cysne
No. The Constant Timer is the delay between the start of one thread
to
Post by Flavio Cysne
Post by umesh prajapati
the
Post by Flavio Cysne
start of the next thread. No relation among threads execution time at
all.
Post by Flavio Cysne
So if thread 1 starts and take 1 second to complete, and Constant
Timer
Post by Flavio Cysne
Post by umesh prajapati
has
Post by Flavio Cysne
300ms delay, then the second thread will start before 1st thread
ends.
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Ramp-up also put this delay in your threads, the same way constant
timer
Post by umesh prajapati
Post by Flavio Cysne
will do. If you want to leverage concurrency remove the timer.
Post by umesh prajapati
If I put the timer, than it means 2nd request has to wait until the
first
Post by Flavio Cysne
Post by umesh prajapati
request is complete. This means if first request is taking time to
process
Post by umesh prajapati
the request than 2nd request will not start until the first request
is
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
completed. Which means there won't be a load but I am doing a load
test.
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
only in the first http sampler
Post by umesh prajapati
one quick question do i add the timer on thread group or the
http
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
reques
Post by Flavio Cysne
Post by umesh prajapati
sampler
On Wed, Aug 14, 2013 at 9:25 AM, umesh prajapati <
Post by umesh prajapati
@ flavio Thanks ...will try it out and let you know the
result.
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by umesh prajapati
On Wed, Aug 14, 2013 at 8:35 AM, Flavio Cysne <
Post by Flavio Cysne
I think you misunderstood me.
"I know in my application, one user is not allowed to login
multiple
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
times until
the session thats logged in is logged out."
Loop 2 threads can't start until all Loop 1 threads are
over.
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Synchronizing
Timer with "Number of simulated users" equal to the number
of
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
threads
Post by Flavio Cysne
Post by umesh prajapati
will
Post by umesh prajapati
Post by Flavio Cysne
ensure this.
That's why I suggest you to use a Constant timer with an
expression.
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
"...But I would like to test the real scenario, where 2000
users
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
login
Post by Flavio Cysne
Post by umesh prajapati
in
Post by umesh prajapati
Post by Flavio Cysne
2
hrs. So, basically 1 min 33 users."
Modify that 300 in Constant Timer expression for the value
equivalent
Post by Flavio Cysne
to
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
time gap for 33 users within 1 minute. (60000ms / 33 users =
~1818ms/user)
Post by umesh prajapati
Post by Flavio Cysne
Regards
umesh prajapati
2013-08-16 15:53:50 UTC
Permalink
I would like to thank you very much for your time and help...it worked out
...:)
Post by Flavio Cysne
Test Plan
- CSV Data Set Config (Recycle on EOF: True, Stop thread on EOF: false,
Sharing mode: All threads)
- Thread Group (threads: 250, rampup: 0, loop: 16)
- HTTP Request 1
- Synchronizing Timer (threads: 250)
- Constant Timer (delay: ${__javaScript(${__threadNum()}*1818)}
// 60000 / 33 = ~1818
- HTTP Request 2
...
- HTTP Request n
Post by umesh prajapati
Thank you very much for making me understand what constant timer is. I
see
Post by umesh prajapati
you mentioned about synchronizing timer . So you have mentioned that
synchronizing timer will start all the threads at the same time. But in
my
Post by umesh prajapati
case, I would like 33 users to login in 1 minute. And lets say i have 250
users in my csv file but I would like to run my test for 2 hrs. And to
accomplish this I am increasing the number of loops. To complete one loop
lets say it takes 8 mins. so I will need around 15-16 loop counts.
Number of threads: 250
Ramo up: 0
Loop: 16
Constant timer to be added before http sampler : (60000/33) ms
So do I need synchronizing timer. Because if I do add synchronizing timer
it will start all 250 users at once (just to be clear when you say start
all at once) did you mean all 250 user login request will be sent at same
time.
Post by Flavio Cysne
When you use Synchronizing Timer all the threads will start at the same
time, when the number of threads started reaches the configured value.
In your test plan Ramp-up will delay the start of the threads, but next
loop execution will break down your test, as you have stated.
Then Constant Timer is used to overcome this issue, delaying the start
time
Post by Flavio Cysne
of the threads as ramp-up does, but not messing thing up after the
first
Post by umesh prajapati
Post by Flavio Cysne
loop.
BTW, your script Threads Group Ramp-up have to be 0 (zero).
Post by umesh prajapati
Thank you but I am still confused. So you mean constant time also
does
Post by umesh prajapati
Post by Flavio Cysne
the
Post by umesh prajapati
same job like ramp-up period. Lets say I have following configuration
Number of threads : 250
Ramp up period : 450
Loop : 3
From what I have understood about rampup. It takes 450 seconds to
complete
Post by umesh prajapati
250 threads. So the delay between thread 1 and thread 2 is 450/250
seconds.
Post by umesh prajapati
So if I also add constant timer to this configuration lets say
(450/250)
Post by Flavio Cysne
Post by umesh prajapati
seconds. I don't get why do we need constant timer when ramp up is
doing
Post by Flavio Cysne
Post by umesh prajapati
the same thing.
Post by Flavio Cysne
No. The Constant Timer is the delay between the start of one thread
to
Post by Flavio Cysne
Post by umesh prajapati
the
Post by Flavio Cysne
start of the next thread. No relation among threads execution time
at
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
all.
Post by Flavio Cysne
So if thread 1 starts and take 1 second to complete, and Constant
Timer
Post by Flavio Cysne
Post by umesh prajapati
has
Post by Flavio Cysne
300ms delay, then the second thread will start before 1st thread
ends.
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Ramp-up also put this delay in your threads, the same way constant
timer
Post by umesh prajapati
Post by Flavio Cysne
will do. If you want to leverage concurrency remove the timer.
Post by umesh prajapati
If I put the timer, than it means 2nd request has to wait until
the
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
first
Post by Flavio Cysne
Post by umesh prajapati
request is complete. This means if first request is taking time
to
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
process
Post by umesh prajapati
the request than 2nd request will not start until the first
request
Post by umesh prajapati
Post by Flavio Cysne
is
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
completed. Which means there won't be a load but I am doing a
load
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
test.
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
only in the first http sampler
Post by umesh prajapati
one quick question do i add the timer on thread group or the
http
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
reques
Post by Flavio Cysne
Post by umesh prajapati
sampler
On Wed, Aug 14, 2013 at 9:25 AM, umesh prajapati <
Post by umesh prajapati
@ flavio Thanks ...will try it out and let you know the
result.
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by umesh prajapati
On Wed, Aug 14, 2013 at 8:35 AM, Flavio Cysne <
Post by Flavio Cysne
I think you misunderstood me.
"I know in my application, one user is not allowed to
login
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
multiple
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
times until
the session thats logged in is logged out."
Loop 2 threads can't start until all Loop 1 threads are
over.
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Synchronizing
Timer with "Number of simulated users" equal to the number
of
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
threads
Post by Flavio Cysne
Post by umesh prajapati
will
Post by umesh prajapati
Post by Flavio Cysne
ensure this.
That's why I suggest you to use a Constant timer with an
expression.
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
"...But I would like to test the real scenario, where 2000
users
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
login
Post by Flavio Cysne
Post by umesh prajapati
in
Post by umesh prajapati
Post by Flavio Cysne
2
hrs. So, basically 1 min 33 users."
Modify that 300 in Constant Timer expression for the value
equivalent
Post by Flavio Cysne
to
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
time gap for 33 users within 1 minute. (60000ms / 33
users =
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
~1818ms/user)
Post by umesh prajapati
Post by Flavio Cysne
Regards
umesh prajapati
2013-08-16 16:55:07 UTC
Permalink
I know this has to do with different topic but i am wondering if you could
help me out on this one too if possible.

I am getting lots of connection reset error.

java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:168)
at
org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:166)
at
org.apache.http.impl.io.SocketInputBuffer.fillBuffer(SocketInputBuffer.java:90)
at
org.apache.http.impl.io.AbstractSessionInputBuffer.readLine(AbstractSessionInputBuffer.java:281)
at
org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:92)
at
org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:62)
at
org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:254)
at
org.apache.http.impl.AbstractHttpClientConnection.receiveResponseHeader(AbstractHttpClientConnection.java:289)
at
org.apache.http.impl.conn.DefaultClientConnection.receiveResponseHeader(DefaultClientConnection.java:252)
at
org.apache.http.impl.conn.ManagedClientConnectionImpl.receiveResponseHeader(ManagedClientConnectionImpl.java:191)
at
org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:300)
at
org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:127)
at
org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:717)
at
org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:522)
at
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
at
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)
at
org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:286)
at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:62)
at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.followRedirects(HTTPSamplerBase.java:1410)
at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.resultProcessing(HTTPSamplerBase.java:1481)
at
org.apache.jmeter.protocol.http.sampler.HTTPAbstractImpl.resultProcessing(HTTPAbstractImpl.java:251)
at
org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:358)
at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:62)
at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1088)
at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1077)
at
org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:428)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:256)
at java.lang.Thread.run(Thread.java:619)
Post by umesh prajapati
I would like to thank you very much for your time and help...it worked out
...:)
Post by Flavio Cysne
Test Plan
- CSV Data Set Config (Recycle on EOF: True, Stop thread on EOF: false,
Sharing mode: All threads)
- Thread Group (threads: 250, rampup: 0, loop: 16)
- HTTP Request 1
- Synchronizing Timer (threads: 250)
${__javaScript(${__threadNum()}*1818)}
// 60000 / 33 = ~1818
- HTTP Request 2
...
- HTTP Request n
Post by umesh prajapati
Thank you very much for making me understand what constant timer is. I
see
Post by umesh prajapati
you mentioned about synchronizing timer . So you have mentioned that
synchronizing timer will start all the threads at the same time. But in
my
Post by umesh prajapati
case, I would like 33 users to login in 1 minute. And lets say i have
250
Post by umesh prajapati
users in my csv file but I would like to run my test for 2 hrs. And to
accomplish this I am increasing the number of loops. To complete one
loop
Post by umesh prajapati
lets say it takes 8 mins. so I will need around 15-16 loop counts.
Number of threads: 250
Ramo up: 0
Loop: 16
Constant timer to be added before http sampler : (60000/33) ms
So do I need synchronizing timer. Because if I do add synchronizing
timer
Post by umesh prajapati
it will start all 250 users at once (just to be clear when you say start
all at once) did you mean all 250 user login request will be sent at
same
Post by umesh prajapati
time.
Post by Flavio Cysne
When you use Synchronizing Timer all the threads will start at the
same
Post by umesh prajapati
Post by Flavio Cysne
time, when the number of threads started reaches the configured value.
In your test plan Ramp-up will delay the start of the threads, but
next
Post by umesh prajapati
Post by Flavio Cysne
loop execution will break down your test, as you have stated.
Then Constant Timer is used to overcome this issue, delaying the start
time
Post by Flavio Cysne
of the threads as ramp-up does, but not messing thing up after the
first
Post by umesh prajapati
Post by Flavio Cysne
loop.
BTW, your script Threads Group Ramp-up have to be 0 (zero).
Post by umesh prajapati
Thank you but I am still confused. So you mean constant time also
does
Post by umesh prajapati
Post by Flavio Cysne
the
Post by umesh prajapati
same job like ramp-up period. Lets say I have following
configuration
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Number of threads : 250
Ramp up period : 450
Loop : 3
From what I have understood about rampup. It takes 450 seconds to
complete
Post by umesh prajapati
250 threads. So the delay between thread 1 and thread 2 is 450/250
seconds.
Post by umesh prajapati
So if I also add constant timer to this configuration lets say
(450/250)
Post by Flavio Cysne
Post by umesh prajapati
seconds. I don't get why do we need constant timer when ramp up is
doing
Post by Flavio Cysne
Post by umesh prajapati
the same thing.
Post by Flavio Cysne
No. The Constant Timer is the delay between the start of one
thread
Post by umesh prajapati
to
Post by Flavio Cysne
Post by umesh prajapati
the
Post by Flavio Cysne
start of the next thread. No relation among threads execution
time at
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
all.
Post by Flavio Cysne
So if thread 1 starts and take 1 second to complete, and Constant
Timer
Post by Flavio Cysne
Post by umesh prajapati
has
Post by Flavio Cysne
300ms delay, then the second thread will start before 1st thread
ends.
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Ramp-up also put this delay in your threads, the same way constant
timer
Post by umesh prajapati
Post by Flavio Cysne
will do. If you want to leverage concurrency remove the timer.
Post by umesh prajapati
If I put the timer, than it means 2nd request has to wait until
the
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
first
Post by Flavio Cysne
Post by umesh prajapati
request is complete. This means if first request is taking time
to
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
process
Post by umesh prajapati
the request than 2nd request will not start until the first
request
Post by umesh prajapati
Post by Flavio Cysne
is
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
completed. Which means there won't be a load but I am doing a
load
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
test.
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
only in the first http sampler
Post by umesh prajapati
one quick question do i add the timer on thread group or the
http
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
reques
Post by Flavio Cysne
Post by umesh prajapati
sampler
On Wed, Aug 14, 2013 at 9:25 AM, umesh prajapati <
Post by umesh prajapati
@ flavio Thanks ...will try it out and let you know the
result.
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by umesh prajapati
On Wed, Aug 14, 2013 at 8:35 AM, Flavio Cysne <
Post by Flavio Cysne
I think you misunderstood me.
"I know in my application, one user is not allowed to
login
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
multiple
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
times until
the session thats logged in is logged out."
Loop 2 threads can't start until all Loop 1 threads are
over.
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Synchronizing
Timer with "Number of simulated users" equal to the
number
Post by umesh prajapati
of
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
threads
Post by Flavio Cysne
Post by umesh prajapati
will
Post by umesh prajapati
Post by Flavio Cysne
ensure this.
That's why I suggest you to use a Constant timer with an
expression.
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
"...But I would like to test the real scenario, where
2000
Post by umesh prajapati
Post by Flavio Cysne
users
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
login
Post by Flavio Cysne
Post by umesh prajapati
in
Post by umesh prajapati
Post by Flavio Cysne
2
hrs. So, basically 1 min 33 users."
Modify that 300 in Constant Timer expression for the
value
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
equivalent
Post by Flavio Cysne
to
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
time gap for 33 users within 1 minute. (60000ms / 33
users =
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
~1818ms/user)
Post by umesh prajapati
Post by Flavio Cysne
Regards
sebb
2013-08-16 17:17:42 UTC
Permalink
Post by umesh prajapati
I know this has to do with different topic
Please start a new thread - with an appropriate subject - for a new topic.
Flavio Cysne
2013-08-16 17:19:26 UTC
Permalink
As sebb said, start a new thread with more explanations about what happened
and we'll be glad to help you
Post by umesh prajapati
I know this has to do with different topic but i am wondering if you could
help me out on this one too if possible.
I am getting lots of connection reset error.
java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:168)
at
org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:166)
at
org.apache.http.impl.io.SocketInputBuffer.fillBuffer(SocketInputBuffer.java:90)
at
org.apache.http.impl.io.AbstractSessionInputBuffer.readLine(AbstractSessionInputBuffer.java:281)
at
org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:92)
at
org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:62)
at
org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:254)
at
org.apache.http.impl.AbstractHttpClientConnection.receiveResponseHeader(AbstractHttpClientConnection.java:289)
at
org.apache.http.impl.conn.DefaultClientConnection.receiveResponseHeader(DefaultClientConnection.java:252)
at
org.apache.http.impl.conn.ManagedClientConnectionImpl.receiveResponseHeader(ManagedClientConnectionImpl.java:191)
at
org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:300)
at
org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:127)
at
org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:717)
at
org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:522)
at
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
at
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)
at
org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:286)
at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:62)
at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.followRedirects(HTTPSamplerBase.java:1410)
at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.resultProcessing(HTTPSamplerBase.java:1481)
at
org.apache.jmeter.protocol.http.sampler.HTTPAbstractImpl.resultProcessing(HTTPAbstractImpl.java:251)
at
org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:358)
at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:62)
at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1088)
at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1077)
at
org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:428)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:256)
at java.lang.Thread.run(Thread.java:619)
Post by umesh prajapati
I would like to thank you very much for your time and help...it worked
out
Post by umesh prajapati
...:)
Post by Flavio Cysne
Test Plan
- CSV Data Set Config (Recycle on EOF: True, Stop thread on EOF: false,
Sharing mode: All threads)
- Thread Group (threads: 250, rampup: 0, loop: 16)
- HTTP Request 1
- Synchronizing Timer (threads: 250)
${__javaScript(${__threadNum()}*1818)}
// 60000 / 33 = ~1818
- HTTP Request 2
...
- HTTP Request n
Post by umesh prajapati
Thank you very much for making me understand what constant timer is. I
see
Post by umesh prajapati
you mentioned about synchronizing timer . So you have mentioned that
synchronizing timer will start all the threads at the same time. But
in
Post by umesh prajapati
Post by Flavio Cysne
my
Post by umesh prajapati
case, I would like 33 users to login in 1 minute. And lets say i have
250
Post by umesh prajapati
users in my csv file but I would like to run my test for 2 hrs. And to
accomplish this I am increasing the number of loops. To complete one
loop
Post by umesh prajapati
lets say it takes 8 mins. so I will need around 15-16 loop counts.
Number of threads: 250
Ramo up: 0
Loop: 16
Constant timer to be added before http sampler : (60000/33) ms
So do I need synchronizing timer. Because if I do add synchronizing
timer
Post by umesh prajapati
it will start all 250 users at once (just to be clear when you say
start
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
all at once) did you mean all 250 user login request will be sent at
same
Post by umesh prajapati
time.
Post by Flavio Cysne
When you use Synchronizing Timer all the threads will start at the
same
Post by umesh prajapati
Post by Flavio Cysne
time, when the number of threads started reaches the configured
value.
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
In your test plan Ramp-up will delay the start of the threads, but
next
Post by umesh prajapati
Post by Flavio Cysne
loop execution will break down your test, as you have stated.
Then Constant Timer is used to overcome this issue, delaying the
start
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
time
Post by Flavio Cysne
of the threads as ramp-up does, but not messing thing up after the
first
Post by umesh prajapati
Post by Flavio Cysne
loop.
BTW, your script Threads Group Ramp-up have to be 0 (zero).
Post by umesh prajapati
Thank you but I am still confused. So you mean constant time also
does
Post by umesh prajapati
Post by Flavio Cysne
the
Post by umesh prajapati
same job like ramp-up period. Lets say I have following
configuration
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Number of threads : 250
Ramp up period : 450
Loop : 3
From what I have understood about rampup. It takes 450 seconds to
complete
Post by umesh prajapati
250 threads. So the delay between thread 1 and thread 2 is 450/250
seconds.
Post by umesh prajapati
So if I also add constant timer to this configuration lets say
(450/250)
Post by Flavio Cysne
Post by umesh prajapati
seconds. I don't get why do we need constant timer when ramp up is
doing
Post by Flavio Cysne
Post by umesh prajapati
the same thing.
Post by Flavio Cysne
No. The Constant Timer is the delay between the start of one
thread
Post by umesh prajapati
to
Post by Flavio Cysne
Post by umesh prajapati
the
Post by Flavio Cysne
start of the next thread. No relation among threads execution
time at
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
all.
Post by Flavio Cysne
So if thread 1 starts and take 1 second to complete, and
Constant
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Timer
Post by Flavio Cysne
Post by umesh prajapati
has
Post by Flavio Cysne
300ms delay, then the second thread will start before 1st thread
ends.
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Ramp-up also put this delay in your threads, the same way
constant
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
timer
Post by umesh prajapati
Post by Flavio Cysne
will do. If you want to leverage concurrency remove the timer.
Post by umesh prajapati
If I put the timer, than it means 2nd request has to wait
until
Post by umesh prajapati
Post by Flavio Cysne
the
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
first
Post by Flavio Cysne
Post by umesh prajapati
request is complete. This means if first request is taking
time
Post by umesh prajapati
Post by Flavio Cysne
to
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
process
Post by umesh prajapati
the request than 2nd request will not start until the first
request
Post by umesh prajapati
Post by Flavio Cysne
is
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
completed. Which means there won't be a load but I am doing a
load
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
test.
Post by Flavio Cysne
Post by umesh prajapati
On Aug 14, 2013 12:50 PM, "Flavio Cysne" <
Post by Flavio Cysne
only in the first http sampler
Post by umesh prajapati
one quick question do i add the timer on thread group or
the
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
http
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
reques
Post by Flavio Cysne
Post by umesh prajapati
sampler
On Wed, Aug 14, 2013 at 9:25 AM, umesh prajapati <
Post by umesh prajapati
@ flavio Thanks ...will try it out and let you know the
result.
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by umesh prajapati
On Wed, Aug 14, 2013 at 8:35 AM, Flavio Cysne <
Post by Flavio Cysne
I think you misunderstood me.
"I know in my application, one user is not allowed to
login
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
multiple
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
times until
the session thats logged in is logged out."
Loop 2 threads can't start until all Loop 1 threads are
over.
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Synchronizing
Timer with "Number of simulated users" equal to the
number
Post by umesh prajapati
of
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
threads
Post by Flavio Cysne
Post by umesh prajapati
will
Post by umesh prajapati
Post by Flavio Cysne
ensure this.
once,..."
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
That's why I suggest you to use a Constant timer with
an
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
expression.
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
"...But I would like to test the real scenario, where
2000
Post by umesh prajapati
Post by Flavio Cysne
users
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
login
Post by Flavio Cysne
Post by umesh prajapati
in
Post by umesh prajapati
Post by Flavio Cysne
2
hrs. So, basically 1 min 33 users."
Modify that 300 in Constant Timer expression for the
value
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
equivalent
Post by Flavio Cysne
to
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
time gap for 33 users within 1 minute. (60000ms / 33
users =
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
~1818ms/user)
Post by umesh prajapati
Post by Flavio Cysne
Regards
umesh prajapati
2013-08-16 17:30:27 UTC
Permalink
I have opened a new thread as both of you have mentioned.

http://jmeter.512774.n5.nabble.com/java-net-SocketException-Connection-reset-td5717859.html
Post by Flavio Cysne
As sebb said, start a new thread with more explanations about what happened
and we'll be glad to help you
Post by umesh prajapati
I know this has to do with different topic but i am wondering if you
could
Post by umesh prajapati
help me out on this one too if possible.
I am getting lots of connection reset error.
java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:168)
at
org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:166)
Post by umesh prajapati
at
org.apache.http.impl.io.SocketInputBuffer.fillBuffer(SocketInputBuffer.java:90)
Post by umesh prajapati
at
org.apache.http.impl.io.AbstractSessionInputBuffer.readLine(AbstractSessionInputBuffer.java:281)
Post by umesh prajapati
at
org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:92)
Post by umesh prajapati
at
org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:62)
Post by umesh prajapati
at
org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:254)
Post by umesh prajapati
at
org.apache.http.impl.AbstractHttpClientConnection.receiveResponseHeader(AbstractHttpClientConnection.java:289)
Post by umesh prajapati
at
org.apache.http.impl.conn.DefaultClientConnection.receiveResponseHeader(DefaultClientConnection.java:252)
Post by umesh prajapati
at
org.apache.http.impl.conn.ManagedClientConnectionImpl.receiveResponseHeader(ManagedClientConnectionImpl.java:191)
Post by umesh prajapati
at
org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:300)
Post by umesh prajapati
at
org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:127)
Post by umesh prajapati
at
org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:717)
Post by umesh prajapati
at
org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:522)
Post by umesh prajapati
at
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
Post by umesh prajapati
at
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)
Post by umesh prajapati
at
org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:286)
Post by umesh prajapati
at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:62)
Post by umesh prajapati
at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.followRedirects(HTTPSamplerBase.java:1410)
Post by umesh prajapati
at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.resultProcessing(HTTPSamplerBase.java:1481)
Post by umesh prajapati
at
org.apache.jmeter.protocol.http.sampler.HTTPAbstractImpl.resultProcessing(HTTPAbstractImpl.java:251)
Post by umesh prajapati
at
org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:358)
Post by umesh prajapati
at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:62)
Post by umesh prajapati
at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1088)
Post by umesh prajapati
at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1077)
Post by umesh prajapati
at
org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:428)
Post by umesh prajapati
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:256)
at java.lang.Thread.run(Thread.java:619)
Post by umesh prajapati
I would like to thank you very much for your time and help...it worked
out
Post by umesh prajapati
...:)
Post by Flavio Cysne
Test Plan
- CSV Data Set Config (Recycle on EOF: True, Stop thread on EOF: false,
Sharing mode: All threads)
- Thread Group (threads: 250, rampup: 0, loop: 16)
- HTTP Request 1
- Synchronizing Timer (threads: 250)
${__javaScript(${__threadNum()}*1818)}
// 60000 / 33 = ~1818
- HTTP Request 2
...
- HTTP Request n
Post by umesh prajapati
Thank you very much for making me understand what constant timer
is. I
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
see
Post by umesh prajapati
you mentioned about synchronizing timer . So you have mentioned that
synchronizing timer will start all the threads at the same time. But
in
Post by umesh prajapati
Post by Flavio Cysne
my
Post by umesh prajapati
case, I would like 33 users to login in 1 minute. And lets say i
have
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
250
Post by umesh prajapati
users in my csv file but I would like to run my test for 2 hrs. And
to
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
accomplish this I am increasing the number of loops. To complete one
loop
Post by umesh prajapati
lets say it takes 8 mins. so I will need around 15-16 loop counts.
Number of threads: 250
Ramo up: 0
Loop: 16
Constant timer to be added before http sampler : (60000/33) ms
So do I need synchronizing timer. Because if I do add synchronizing
timer
Post by umesh prajapati
it will start all 250 users at once (just to be clear when you say
start
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
all at once) did you mean all 250 user login request will be sent at
same
Post by umesh prajapati
time.
Post by Flavio Cysne
When you use Synchronizing Timer all the threads will start at the
same
Post by umesh prajapati
Post by Flavio Cysne
time, when the number of threads started reaches the configured
value.
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
In your test plan Ramp-up will delay the start of the threads, but
next
Post by umesh prajapati
Post by Flavio Cysne
loop execution will break down your test, as you have stated.
Then Constant Timer is used to overcome this issue, delaying the
start
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
time
Post by Flavio Cysne
of the threads as ramp-up does, but not messing thing up after the
first
Post by umesh prajapati
Post by Flavio Cysne
loop.
BTW, your script Threads Group Ramp-up have to be 0 (zero).
Post by umesh prajapati
Thank you but I am still confused. So you mean constant time
also
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
does
Post by umesh prajapati
Post by Flavio Cysne
the
Post by umesh prajapati
same job like ramp-up period. Lets say I have following
configuration
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Number of threads : 250
Ramp up period : 450
Loop : 3
From what I have understood about rampup. It takes 450 seconds
to
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
complete
Post by umesh prajapati
250 threads. So the delay between thread 1 and thread 2 is
450/250
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
seconds.
Post by umesh prajapati
So if I also add constant timer to this configuration lets say
(450/250)
Post by Flavio Cysne
Post by umesh prajapati
seconds. I don't get why do we need constant timer when ramp up
is
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
doing
Post by Flavio Cysne
Post by umesh prajapati
the same thing.
Post by Flavio Cysne
No. The Constant Timer is the delay between the start of one
thread
Post by umesh prajapati
to
Post by Flavio Cysne
Post by umesh prajapati
the
Post by Flavio Cysne
start of the next thread. No relation among threads execution
time at
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
all.
Post by Flavio Cysne
So if thread 1 starts and take 1 second to complete, and
Constant
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Timer
Post by Flavio Cysne
Post by umesh prajapati
has
Post by Flavio Cysne
300ms delay, then the second thread will start before 1st
thread
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
ends.
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Ramp-up also put this delay in your threads, the same way
constant
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
timer
Post by umesh prajapati
Post by Flavio Cysne
will do. If you want to leverage concurrency remove the timer.
Post by umesh prajapati
If I put the timer, than it means 2nd request has to wait
until
Post by umesh prajapati
Post by Flavio Cysne
the
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
first
Post by Flavio Cysne
Post by umesh prajapati
request is complete. This means if first request is taking
time
Post by umesh prajapati
Post by Flavio Cysne
to
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
process
Post by umesh prajapati
the request than 2nd request will not start until the first
request
Post by umesh prajapati
Post by Flavio Cysne
is
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
completed. Which means there won't be a load but I am
doing a
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
load
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
test.
Post by Flavio Cysne
Post by umesh prajapati
On Aug 14, 2013 12:50 PM, "Flavio Cysne" <
Post by Flavio Cysne
only in the first http sampler
Post by umesh prajapati
one quick question do i add the timer on thread group or
the
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
http
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
reques
Post by Flavio Cysne
Post by umesh prajapati
sampler
On Wed, Aug 14, 2013 at 9:25 AM, umesh prajapati <
Post by umesh prajapati
@ flavio Thanks ...will try it out and let you know
the
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
result.
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by umesh prajapati
On Wed, Aug 14, 2013 at 8:35 AM, Flavio Cysne <
Post by Flavio Cysne
I think you misunderstood me.
"I know in my application, one user is not allowed to
login
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
multiple
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
times until
the session thats logged in is logged out."
Loop 2 threads can't start until all Loop 1 threads
are
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
over.
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Synchronizing
Timer with "Number of simulated users" equal to the
number
Post by umesh prajapati
of
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
threads
Post by Flavio Cysne
Post by umesh prajapati
will
Post by umesh prajapati
Post by Flavio Cysne
ensure this.
once,..."
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
That's why I suggest you to use a Constant timer with
an
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
expression.
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
"...But I would like to test the real scenario, where
2000
Post by umesh prajapati
Post by Flavio Cysne
users
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
login
Post by Flavio Cysne
Post by umesh prajapati
in
Post by umesh prajapati
Post by Flavio Cysne
2
hrs. So, basically 1 min 33 users."
Modify that 300 in Constant Timer expression for the
value
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
equivalent
Post by Flavio Cysne
to
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
time gap for 33 users within 1 minute. (60000ms / 33
users =
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
~1818ms/user)
Post by umesh prajapati
Post by Flavio Cysne
Regards
umesh prajapati
2013-08-19 18:32:10 UTC
Permalink
I have my test script as you have mentioned above.

But I am wondering if I use schedular instead of loop. It is not working as
I expected.

Requirement as mentioned above. (1hr = 2000 users, so 1 min 33 users)

with below configuration:
threads:33
ramp up:0
loop:1

synchronizing timer: 33
constant timer: ${__javaScript(${__threadNum()}*1818)}

It takes around 1 min to complete the test.

but when I use shcedular with following configuration

threads: 5
ramp up:0
loop: forever

shedular duration: 60 sec. .It doesnt complete the expected transaction. It
completes around 25. When I ran for 2 hrs, expected was 4000 but only
completed 2980.

synchronizing timer: 5
constant timer: ${__javaScript(${__threadNum()}*1818)}


with this configuration
threads:33
ramp up: 0
loop:forever

schedular duration:60 sec. it completes around 30-33 transaction. (I didnt
try for 2 hrs)

synchronizing timer: 33
constant timer: ${__javaScript(${__threadNum()}*1818)}
Post by umesh prajapati
I have opened a new thread as both of you have mentioned.
http://jmeter.512774.n5.nabble.com/java-net-SocketException-Connection-reset-td5717859.html
Post by Flavio Cysne
As sebb said, start a new thread with more explanations about what happened
and we'll be glad to help you
Post by umesh prajapati
I know this has to do with different topic but i am wondering if you
could
Post by umesh prajapati
help me out on this one too if possible.
I am getting lots of connection reset error.
java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:168)
at
org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:166)
Post by umesh prajapati
at
org.apache.http.impl.io.SocketInputBuffer.fillBuffer(SocketInputBuffer.java:90)
Post by umesh prajapati
at
org.apache.http.impl.io.AbstractSessionInputBuffer.readLine(AbstractSessionInputBuffer.java:281)
Post by umesh prajapati
at
org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:92)
Post by umesh prajapati
at
org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:62)
Post by umesh prajapati
at
org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:254)
Post by umesh prajapati
at
org.apache.http.impl.AbstractHttpClientConnection.receiveResponseHeader(AbstractHttpClientConnection.java:289)
Post by umesh prajapati
at
org.apache.http.impl.conn.DefaultClientConnection.receiveResponseHeader(DefaultClientConnection.java:252)
Post by umesh prajapati
at
org.apache.http.impl.conn.ManagedClientConnectionImpl.receiveResponseHeader(ManagedClientConnectionImpl.java:191)
Post by umesh prajapati
at
org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:300)
Post by umesh prajapati
at
org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:127)
Post by umesh prajapati
at
org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:717)
Post by umesh prajapati
at
org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:522)
Post by umesh prajapati
at
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
Post by umesh prajapati
at
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)
Post by umesh prajapati
at
org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:286)
Post by umesh prajapati
at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:62)
Post by umesh prajapati
at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.followRedirects(HTTPSamplerBase.java:1410)
Post by umesh prajapati
at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.resultProcessing(HTTPSamplerBase.java:1481)
Post by umesh prajapati
at
org.apache.jmeter.protocol.http.sampler.HTTPAbstractImpl.resultProcessing(HTTPAbstractImpl.java:251)
Post by umesh prajapati
at
org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:358)
Post by umesh prajapati
at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:62)
Post by umesh prajapati
at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1088)
Post by umesh prajapati
at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1077)
Post by umesh prajapati
at
org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:428)
Post by umesh prajapati
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:256)
at java.lang.Thread.run(Thread.java:619)
Post by umesh prajapati
I would like to thank you very much for your time and help...it worked
out
Post by umesh prajapati
...:)
Post by Flavio Cysne
Test Plan
- CSV Data Set Config (Recycle on EOF: True, Stop thread on EOF: false,
Sharing mode: All threads)
- Thread Group (threads: 250, rampup: 0, loop: 16)
- HTTP Request 1
- Synchronizing Timer (threads: 250)
${__javaScript(${__threadNum()}*1818)}
// 60000 / 33 = ~1818
- HTTP Request 2
...
- HTTP Request n
Post by umesh prajapati
Thank you very much for making me understand what constant timer
is. I
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
see
Post by umesh prajapati
you mentioned about synchronizing timer . So you have mentioned
that
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
synchronizing timer will start all the threads at the same time.
But
Post by umesh prajapati
in
Post by umesh prajapati
Post by Flavio Cysne
my
Post by umesh prajapati
case, I would like 33 users to login in 1 minute. And lets say i
have
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
250
Post by umesh prajapati
users in my csv file but I would like to run my test for 2 hrs.
And to
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
accomplish this I am increasing the number of loops. To complete
one
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
loop
Post by umesh prajapati
lets say it takes 8 mins. so I will need around 15-16 loop counts.
Number of threads: 250
Ramo up: 0
Loop: 16
Constant timer to be added before http sampler : (60000/33) ms
So do I need synchronizing timer. Because if I do add synchronizing
timer
Post by umesh prajapati
it will start all 250 users at once (just to be clear when you say
start
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
all at once) did you mean all 250 user login request will be sent
at
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
same
Post by umesh prajapati
time.
Post by Flavio Cysne
When you use Synchronizing Timer all the threads will start at
the
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
same
Post by umesh prajapati
Post by Flavio Cysne
time, when the number of threads started reaches the configured
value.
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
In your test plan Ramp-up will delay the start of the threads,
but
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
next
Post by umesh prajapati
Post by Flavio Cysne
loop execution will break down your test, as you have stated.
Then Constant Timer is used to overcome this issue, delaying the
start
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
time
Post by Flavio Cysne
of the threads as ramp-up does, but not messing thing up after
the
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
first
Post by umesh prajapati
Post by Flavio Cysne
loop.
BTW, your script Threads Group Ramp-up have to be 0 (zero).
Post by umesh prajapati
Thank you but I am still confused. So you mean constant time
also
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
does
Post by umesh prajapati
Post by Flavio Cysne
the
Post by umesh prajapati
same job like ramp-up period. Lets say I have following
configuration
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Number of threads : 250
Ramp up period : 450
Loop : 3
From what I have understood about rampup. It takes 450 seconds
to
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
complete
Post by umesh prajapati
250 threads. So the delay between thread 1 and thread 2 is
450/250
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
seconds.
Post by umesh prajapati
So if I also add constant timer to this configuration lets say
(450/250)
Post by Flavio Cysne
Post by umesh prajapati
seconds. I don't get why do we need constant timer when ramp
up is
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
doing
Post by Flavio Cysne
Post by umesh prajapati
the same thing.
Post by Flavio Cysne
No. The Constant Timer is the delay between the start of one
thread
Post by umesh prajapati
to
Post by Flavio Cysne
Post by umesh prajapati
the
Post by Flavio Cysne
start of the next thread. No relation among threads execution
time at
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
all.
Post by Flavio Cysne
So if thread 1 starts and take 1 second to complete, and
Constant
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Timer
Post by Flavio Cysne
Post by umesh prajapati
has
Post by Flavio Cysne
300ms delay, then the second thread will start before 1st
thread
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
ends.
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Ramp-up also put this delay in your threads, the same way
constant
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
timer
Post by umesh prajapati
Post by Flavio Cysne
will do. If you want to leverage concurrency remove the
timer.
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
If I put the timer, than it means 2nd request has to wait
until
Post by umesh prajapati
Post by Flavio Cysne
the
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
first
Post by Flavio Cysne
Post by umesh prajapati
request is complete. This means if first request is taking
time
Post by umesh prajapati
Post by Flavio Cysne
to
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
process
Post by umesh prajapati
the request than 2nd request will not start until the first
request
Post by umesh prajapati
Post by Flavio Cysne
is
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
completed. Which means there won't be a load but I am
doing a
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
load
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
test.
Post by Flavio Cysne
Post by umesh prajapati
On Aug 14, 2013 12:50 PM, "Flavio Cysne" <
Post by Flavio Cysne
only in the first http sampler
Post by umesh prajapati
one quick question do i add the timer on thread group
or
Post by umesh prajapati
the
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
http
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
reques
Post by Flavio Cysne
Post by umesh prajapati
sampler
On Wed, Aug 14, 2013 at 9:25 AM, umesh prajapati <
Post by umesh prajapati
@ flavio Thanks ...will try it out and let you know
the
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
result.
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by umesh prajapati
On Wed, Aug 14, 2013 at 8:35 AM, Flavio Cysne <
Post by Flavio Cysne
I think you misunderstood me.
"I know in my application, one user is not allowed
to
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
login
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
multiple
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
times until
the session thats logged in is logged out."
Loop 2 threads can't start until all Loop 1 threads
are
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
over.
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Synchronizing
Timer with "Number of simulated users" equal to the
number
Post by umesh prajapati
of
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
threads
Post by Flavio Cysne
Post by umesh prajapati
will
Post by umesh prajapati
Post by Flavio Cysne
ensure this.
once,..."
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
That's why I suggest you to use a Constant timer
with
Post by umesh prajapati
an
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
expression.
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
"...But I would like to test the real scenario,
where
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
2000
Post by umesh prajapati
Post by Flavio Cysne
users
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
login
Post by Flavio Cysne
Post by umesh prajapati
in
Post by umesh prajapati
Post by Flavio Cysne
2
hrs. So, basically 1 min 33 users."
Modify that 300 in Constant Timer expression for the
value
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
equivalent
Post by Flavio Cysne
to
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
time gap for 33 users within 1 minute. (60000ms / 33
users =
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
~1818ms/user)
Post by umesh prajapati
Post by Flavio Cysne
Regards
Flavio Cysne
2013-08-19 18:55:59 UTC
Permalink
Use a Runtime Controller wrapping all your resquests, then configure it for
the elapsing time you desire.
Post by umesh prajapati
I have my test script as you have mentioned above.
But I am wondering if I use schedular instead of loop. It is not working as
I expected.
Requirement as mentioned above. (1hr = 2000 users, so 1 min 33 users)
threads:33
ramp up:0
loop:1
synchronizing timer: 33
constant timer: ${__javaScript(${__threadNum()}*1818)}
It takes around 1 min to complete the test.
but when I use shcedular with following configuration
threads: 5
ramp up:0
loop: forever
shedular duration: 60 sec. .It doesnt complete the expected transaction. It
completes around 25. When I ran for 2 hrs, expected was 4000 but only
completed 2980.
synchronizing timer: 5
constant timer: ${__javaScript(${__threadNum()}*1818)}
with this configuration
threads:33
ramp up: 0
loop:forever
schedular duration:60 sec. it completes around 30-33 transaction. (I didnt
try for 2 hrs)
synchronizing timer: 33
constant timer: ${__javaScript(${__threadNum()}*1818)}
Post by umesh prajapati
I have opened a new thread as both of you have mentioned.
http://jmeter.512774.n5.nabble.com/java-net-SocketException-Connection-reset-td5717859.html
Post by umesh prajapati
Post by Flavio Cysne
As sebb said, start a new thread with more explanations about what happened
and we'll be glad to help you
Post by umesh prajapati
I know this has to do with different topic but i am wondering if you
could
Post by umesh prajapati
help me out on this one too if possible.
I am getting lots of connection reset error.
java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:168)
at
org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:166)
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
at
org.apache.http.impl.io.SocketInputBuffer.fillBuffer(SocketInputBuffer.java:90)
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
at
org.apache.http.impl.io.AbstractSessionInputBuffer.readLine(AbstractSessionInputBuffer.java:281)
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
at
org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:92)
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
at
org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:62)
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
at
org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:254)
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
at
org.apache.http.impl.AbstractHttpClientConnection.receiveResponseHeader(AbstractHttpClientConnection.java:289)
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
at
org.apache.http.impl.conn.DefaultClientConnection.receiveResponseHeader(DefaultClientConnection.java:252)
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
at
org.apache.http.impl.conn.ManagedClientConnectionImpl.receiveResponseHeader(ManagedClientConnectionImpl.java:191)
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
at
org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:300)
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
at
org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:127)
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
at
org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:717)
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
at
org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:522)
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
at
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
at
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
at
org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:286)
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:62)
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.followRedirects(HTTPSamplerBase.java:1410)
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.resultProcessing(HTTPSamplerBase.java:1481)
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
at
org.apache.jmeter.protocol.http.sampler.HTTPAbstractImpl.resultProcessing(HTTPAbstractImpl.java:251)
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
at
org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:358)
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:62)
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1088)
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1077)
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
at
org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:428)
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:256)
at java.lang.Thread.run(Thread.java:619)
On Fri, Aug 16, 2013 at 8:53 AM, umesh prajapati <
Post by umesh prajapati
I would like to thank you very much for your time and help...it
worked
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
out
Post by umesh prajapati
...:)
On Fri, Aug 16, 2013 at 8:07 AM, Flavio Cysne <
Post by Flavio Cysne
Test Plan
- CSV Data Set Config (Recycle on EOF: True, Stop thread on
false,
Sharing mode: All threads)
- Thread Group (threads: 250, rampup: 0, loop: 16)
- HTTP Request 1
- Synchronizing Timer (threads: 250)
${__javaScript(${__threadNum()}*1818)}
// 60000 / 33 = ~1818
- HTTP Request 2
...
- HTTP Request n
Post by umesh prajapati
Thank you very much for making me understand what constant timer
is. I
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
see
Post by umesh prajapati
you mentioned about synchronizing timer . So you have mentioned
that
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
synchronizing timer will start all the threads at the same time.
But
Post by umesh prajapati
in
Post by umesh prajapati
Post by Flavio Cysne
my
Post by umesh prajapati
case, I would like 33 users to login in 1 minute. And lets say i
have
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
250
Post by umesh prajapati
users in my csv file but I would like to run my test for 2 hrs.
And to
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
accomplish this I am increasing the number of loops. To complete
one
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
loop
Post by umesh prajapati
lets say it takes 8 mins. so I will need around 15-16 loop
counts.
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Number of threads: 250
Ramo up: 0
Loop: 16
Constant timer to be added before http sampler : (60000/33) ms
So do I need synchronizing timer. Because if I do add
synchronizing
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
timer
Post by umesh prajapati
it will start all 250 users at once (just to be clear when you
say
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
start
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
all at once) did you mean all 250 user login request will be sent
at
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
same
Post by umesh prajapati
time.
Post by Flavio Cysne
When you use Synchronizing Timer all the threads will start at
the
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
same
Post by umesh prajapati
Post by Flavio Cysne
time, when the number of threads started reaches the configured
value.
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
In your test plan Ramp-up will delay the start of the threads,
but
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
next
Post by umesh prajapati
Post by Flavio Cysne
loop execution will break down your test, as you have stated.
Then Constant Timer is used to overcome this issue, delaying
the
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
start
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
time
Post by Flavio Cysne
of the threads as ramp-up does, but not messing thing up after
the
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
first
Post by umesh prajapati
Post by Flavio Cysne
loop.
BTW, your script Threads Group Ramp-up have to be 0 (zero).
Post by umesh prajapati
Thank you but I am still confused. So you mean constant time
also
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
does
Post by umesh prajapati
Post by Flavio Cysne
the
Post by umesh prajapati
same job like ramp-up period. Lets say I have following
configuration
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Number of threads : 250
Ramp up period : 450
Loop : 3
From what I have understood about rampup. It takes 450
seconds
Post by umesh prajapati
Post by Flavio Cysne
to
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
complete
Post by umesh prajapati
250 threads. So the delay between thread 1 and thread 2 is
450/250
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
seconds.
Post by umesh prajapati
So if I also add constant timer to this configuration lets
say
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
(450/250)
Post by Flavio Cysne
Post by umesh prajapati
seconds. I don't get why do we need constant timer when ramp
up is
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
doing
Post by Flavio Cysne
Post by umesh prajapati
the same thing.
On Aug 16, 2013 4:51 AM, "Flavio Cysne" <
Post by Flavio Cysne
No. The Constant Timer is the delay between the start of
one
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
thread
Post by umesh prajapati
to
Post by Flavio Cysne
Post by umesh prajapati
the
Post by Flavio Cysne
start of the next thread. No relation among threads
execution
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
time at
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
all.
Post by Flavio Cysne
So if thread 1 starts and take 1 second to complete, and
Constant
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Timer
Post by Flavio Cysne
Post by umesh prajapati
has
Post by Flavio Cysne
300ms delay, then the second thread will start before 1st
thread
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
ends.
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Ramp-up also put this delay in your threads, the same way
constant
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
timer
Post by umesh prajapati
Post by Flavio Cysne
will do. If you want to leverage concurrency remove the
timer.
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
If I put the timer, than it means 2nd request has to wait
until
Post by umesh prajapati
Post by Flavio Cysne
the
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
first
Post by Flavio Cysne
Post by umesh prajapati
request is complete. This means if first request is
taking
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
time
Post by umesh prajapati
Post by Flavio Cysne
to
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
process
Post by umesh prajapati
the request than 2nd request will not start until the
first
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
request
Post by umesh prajapati
Post by Flavio Cysne
is
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
completed. Which means there won't be a load but I am
doing a
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
load
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
test.
Post by Flavio Cysne
Post by umesh prajapati
On Aug 14, 2013 12:50 PM, "Flavio Cysne" <
Post by Flavio Cysne
only in the first http sampler
Post by umesh prajapati
one quick question do i add the timer on thread group
or
Post by umesh prajapati
the
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
http
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
reques
Post by Flavio Cysne
Post by umesh prajapati
sampler
On Wed, Aug 14, 2013 at 9:25 AM, umesh prajapati <
Post by umesh prajapati
@ flavio Thanks ...will try it out and let you know
the
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
result.
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by umesh prajapati
On Wed, Aug 14, 2013 at 8:35 AM, Flavio Cysne <
Post by Flavio Cysne
I think you misunderstood me.
"I know in my application, one user is not allowed
to
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
login
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
multiple
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
times until
the session thats logged in is logged out."
Loop 2 threads can't start until all Loop 1
threads
Post by umesh prajapati
Post by Flavio Cysne
are
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
over.
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Synchronizing
Timer with "Number of simulated users" equal to
the
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
number
Post by umesh prajapati
of
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
threads
Post by Flavio Cysne
Post by umesh prajapati
will
Post by umesh prajapati
Post by Flavio Cysne
ensure this.
once,..."
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
That's why I suggest you to use a Constant timer
with
Post by umesh prajapati
an
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
expression.
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
"...But I would like to test the real scenario,
where
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
2000
Post by umesh prajapati
Post by Flavio Cysne
users
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
login
Post by Flavio Cysne
Post by umesh prajapati
in
Post by umesh prajapati
Post by Flavio Cysne
2
hrs. So, basically 1 min 33 users."
Modify that 300 in Constant Timer expression for
the
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
value
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
equivalent
Post by Flavio Cysne
to
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
time gap for 33 users within 1 minute. (60000ms /
33
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
users =
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
~1818ms/user)
Post by umesh prajapati
Post by Flavio Cysne
Regards
umesh prajapati
2013-08-19 19:16:19 UTC
Permalink
Correct me If i am wrong.

Under thread Group add Runtime controller

Thread group
# threads: 5
Ramp up: 0
loop count: forever


Runtime controller (seconds): 60
|
|-- login
| |
| |-- synchronizing timer : 5
| |
| |-- constant timer :
${__javaScript(${__threadNum()}*1818)}
|
|--logout


Its not stopping after 60 seconds. Is it because of loop count forever. ( I
thought it would stop when it reaches transaction around 30-33)
Post by Flavio Cysne
Use a Runtime Controller wrapping all your resquests, then configure it for
the elapsing time you desire.
Post by umesh prajapati
I have my test script as you have mentioned above.
But I am wondering if I use schedular instead of loop. It is not working
as
Post by umesh prajapati
I expected.
Requirement as mentioned above. (1hr = 2000 users, so 1 min 33 users)
threads:33
ramp up:0
loop:1
synchronizing timer: 33
constant timer: ${__javaScript(${__threadNum()}*1818)}
It takes around 1 min to complete the test.
but when I use shcedular with following configuration
threads: 5
ramp up:0
loop: forever
shedular duration: 60 sec. .It doesnt complete the expected transaction.
It
Post by umesh prajapati
completes around 25. When I ran for 2 hrs, expected was 4000 but only
completed 2980.
synchronizing timer: 5
constant timer: ${__javaScript(${__threadNum()}*1818)}
with this configuration
threads:33
ramp up: 0
loop:forever
schedular duration:60 sec. it completes around 30-33 transaction. (I
didnt
Post by umesh prajapati
try for 2 hrs)
synchronizing timer: 33
constant timer: ${__javaScript(${__threadNum()}*1818)}
Post by umesh prajapati
I have opened a new thread as both of you have mentioned.
http://jmeter.512774.n5.nabble.com/java-net-SocketException-Connection-reset-td5717859.html
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
As sebb said, start a new thread with more explanations about what happened
and we'll be glad to help you
Post by umesh prajapati
I know this has to do with different topic but i am wondering if you
could
Post by umesh prajapati
help me out on this one too if possible.
I am getting lots of connection reset error.
java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:168)
at
org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:166)
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
at
org.apache.http.impl.io.SocketInputBuffer.fillBuffer(SocketInputBuffer.java:90)
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
at
org.apache.http.impl.io.AbstractSessionInputBuffer.readLine(AbstractSessionInputBuffer.java:281)
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
at
org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:92)
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
at
org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:62)
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
at
org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:254)
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
at
org.apache.http.impl.AbstractHttpClientConnection.receiveResponseHeader(AbstractHttpClientConnection.java:289)
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
at
org.apache.http.impl.conn.DefaultClientConnection.receiveResponseHeader(DefaultClientConnection.java:252)
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
at
org.apache.http.impl.conn.ManagedClientConnectionImpl.receiveResponseHeader(ManagedClientConnectionImpl.java:191)
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
at
org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:300)
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
at
org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:127)
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
at
org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:717)
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
at
org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:522)
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
at
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
at
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
at
org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:286)
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:62)
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.followRedirects(HTTPSamplerBase.java:1410)
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.resultProcessing(HTTPSamplerBase.java:1481)
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
at
org.apache.jmeter.protocol.http.sampler.HTTPAbstractImpl.resultProcessing(HTTPAbstractImpl.java:251)
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
at
org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:358)
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:62)
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1088)
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1077)
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
at
org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:428)
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
at
org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:256)
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
at java.lang.Thread.run(Thread.java:619)
On Fri, Aug 16, 2013 at 8:53 AM, umesh prajapati <
Post by umesh prajapati
I would like to thank you very much for your time and help...it
worked
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
out
Post by umesh prajapati
...:)
On Fri, Aug 16, 2013 at 8:07 AM, Flavio Cysne <
Post by Flavio Cysne
Test Plan
- CSV Data Set Config (Recycle on EOF: True, Stop thread on
false,
Sharing mode: All threads)
- Thread Group (threads: 250, rampup: 0, loop: 16)
- HTTP Request 1
- Synchronizing Timer (threads: 250)
${__javaScript(${__threadNum()}*1818)}
// 60000 / 33 = ~1818
- HTTP Request 2
...
- HTTP Request n
Post by umesh prajapati
Thank you very much for making me understand what constant
timer
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
is. I
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
see
Post by umesh prajapati
you mentioned about synchronizing timer . So you have mentioned
that
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
synchronizing timer will start all the threads at the same
time.
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
But
Post by umesh prajapati
in
Post by umesh prajapati
Post by Flavio Cysne
my
Post by umesh prajapati
case, I would like 33 users to login in 1 minute. And lets say
i
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
have
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
250
Post by umesh prajapati
users in my csv file but I would like to run my test for 2 hrs.
And to
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
accomplish this I am increasing the number of loops. To
complete
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
one
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
loop
Post by umesh prajapati
lets say it takes 8 mins. so I will need around 15-16 loop
counts.
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Number of threads: 250
Ramo up: 0
Loop: 16
Constant timer to be added before http sampler : (60000/33) ms
So do I need synchronizing timer. Because if I do add
synchronizing
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
timer
Post by umesh prajapati
it will start all 250 users at once (just to be clear when you
say
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
start
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
all at once) did you mean all 250 user login request will be
sent
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
at
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
same
Post by umesh prajapati
time.
On Aug 16, 2013 7:18 AM, "Flavio Cysne" <
Post by Flavio Cysne
When you use Synchronizing Timer all the threads will start
at
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
the
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
same
Post by umesh prajapati
Post by Flavio Cysne
time, when the number of threads started reaches the
configured
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
value.
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
In your test plan Ramp-up will delay the start of the
threads,
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
but
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
next
Post by umesh prajapati
Post by Flavio Cysne
loop execution will break down your test, as you have stated.
Then Constant Timer is used to overcome this issue, delaying
the
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
start
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
time
Post by Flavio Cysne
of the threads as ramp-up does, but not messing thing up
after
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
the
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
first
Post by umesh prajapati
Post by Flavio Cysne
loop.
BTW, your script Threads Group Ramp-up have to be 0 (zero).
Post by umesh prajapati
Thank you but I am still confused. So you mean constant
time
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
also
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
does
Post by umesh prajapati
Post by Flavio Cysne
the
Post by umesh prajapati
same job like ramp-up period. Lets say I have following
configuration
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Number of threads : 250
Ramp up period : 450
Loop : 3
From what I have understood about rampup. It takes 450
seconds
Post by umesh prajapati
Post by Flavio Cysne
to
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
complete
Post by umesh prajapati
250 threads. So the delay between thread 1 and thread 2 is
450/250
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
seconds.
Post by umesh prajapati
So if I also add constant timer to this configuration lets
say
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
(450/250)
Post by Flavio Cysne
Post by umesh prajapati
seconds. I don't get why do we need constant timer when
ramp
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
up is
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
doing
Post by Flavio Cysne
Post by umesh prajapati
the same thing.
On Aug 16, 2013 4:51 AM, "Flavio Cysne" <
Post by Flavio Cysne
No. The Constant Timer is the delay between the start of
one
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
thread
Post by umesh prajapati
to
Post by Flavio Cysne
Post by umesh prajapati
the
Post by Flavio Cysne
start of the next thread. No relation among threads
execution
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
time at
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
all.
Post by Flavio Cysne
So if thread 1 starts and take 1 second to complete, and
Constant
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Timer
Post by Flavio Cysne
Post by umesh prajapati
has
Post by Flavio Cysne
300ms delay, then the second thread will start before 1st
thread
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
ends.
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Ramp-up also put this delay in your threads, the same way
constant
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
timer
Post by umesh prajapati
Post by Flavio Cysne
will do. If you want to leverage concurrency remove the
timer.
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
If I put the timer, than it means 2nd request has to
wait
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
until
Post by umesh prajapati
Post by Flavio Cysne
the
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
first
Post by Flavio Cysne
Post by umesh prajapati
request is complete. This means if first request is
taking
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
time
Post by umesh prajapati
Post by Flavio Cysne
to
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
process
Post by umesh prajapati
the request than 2nd request will not start until the
first
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
request
Post by umesh prajapati
Post by Flavio Cysne
is
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
completed. Which means there won't be a load but I am
doing a
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
load
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
test.
Post by Flavio Cysne
Post by umesh prajapati
On Aug 14, 2013 12:50 PM, "Flavio Cysne" <
Post by Flavio Cysne
only in the first http sampler
Post by umesh prajapati
one quick question do i add the timer on thread
group
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
or
Post by umesh prajapati
the
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
http
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
reques
Post by Flavio Cysne
Post by umesh prajapati
sampler
On Wed, Aug 14, 2013 at 9:25 AM, umesh prajapati <
Post by umesh prajapati
@ flavio Thanks ...will try it out and let you
know
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
the
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
result.
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by umesh prajapati
On Wed, Aug 14, 2013 at 8:35 AM, Flavio Cysne <
Post by Flavio Cysne
I think you misunderstood me.
"I know in my application, one user is not
allowed
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
to
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
login
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
multiple
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
times until
the session thats logged in is logged out."
Loop 2 threads can't start until all Loop 1
threads
Post by umesh prajapati
Post by Flavio Cysne
are
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
over.
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
Synchronizing
Timer with "Number of simulated users" equal to
the
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
number
Post by umesh prajapati
of
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
threads
Post by Flavio Cysne
Post by umesh prajapati
will
Post by umesh prajapati
Post by Flavio Cysne
ensure this.
once,..."
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
That's why I suggest you to use a Constant timer
with
Post by umesh prajapati
an
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
expression.
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
"...But I would like to test the real scenario,
where
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
2000
Post by umesh prajapati
Post by Flavio Cysne
users
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
login
Post by Flavio Cysne
Post by umesh prajapati
in
Post by umesh prajapati
Post by Flavio Cysne
2
hrs. So, basically 1 min 33 users."
Modify that 300 in Constant Timer expression for
the
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
value
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
equivalent
Post by Flavio Cysne
to
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
time gap for 33 users within 1 minute. (60000ms
/
Post by umesh prajapati
33
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by umesh prajapati
Post by Flavio Cysne
users =
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
Post by Flavio Cysne
Post by umesh prajapati
~1818ms/user)
Post by umesh prajapati
Post by Flavio Cysne
Regards
Flavio Cysne
2013-08-19 20:21:32 UTC
Permalink
Post by umesh prajapati
Its not stopping after 60 seconds. Is it because of loop count forever.
yes, with this new approach you'll need Loop forever no more. Just let loop
count at 1.
Runtime Controller will "loop" all requests inside it until the configured
time has gone.
Note that script execution time could be greater than the configured time
because Runtime Controller will start new threads within the time
configured and these started threads will run until the last request.
umesh prajapati
2013-08-19 21:14:37 UTC
Permalink
Using this approach too,

it only completes 25 transaction per min when it is suppose to do 33
transaction per min.

So, I just changed the value in constant timer.

From: ${__javaScript(${__threadNum()}*1818)}

To: ${__javaScript(${__threadNum()}*1300)}
Post by Flavio Cysne
Post by umesh prajapati
Its not stopping after 60 seconds. Is it because of loop count forever.
yes, with this new approach you'll need Loop forever no more. Just let loop
count at 1.
Runtime Controller will "loop" all requests inside it until the configured
time has gone.
Note that script execution time could be greater than the configured time
because Runtime Controller will start new threads within the time
configured and these started threads will run until the last request.
umesh prajapati
2013-08-19 21:18:00 UTC
Permalink
${__javaScript(${__threadNum()}*1300)} does this means number of threads *
1300?
Post by umesh prajapati
Using this approach too,
it only completes 25 transaction per min when it is suppose to do 33
transaction per min.
So, I just changed the value in constant timer.
From: ${__javaScript(${__threadNum()}*1818)}
To: ${__javaScript(${__threadNum()}*1300)}
Post by Flavio Cysne
Post by umesh prajapati
Its not stopping after 60 seconds. Is it because of loop count forever.
yes, with this new approach you'll need Loop forever no more. Just let loop
count at 1.
Runtime Controller will "loop" all requests inside it until the configured
time has gone.
Note that script execution time could be greater than the configured time
because Runtime Controller will start new threads within the time
configured and these started threads will run until the last request.
Flavio Cysne
2013-08-20 11:45:55 UTC
Permalink
__threadNum() is a function that return the actual thread number, so, if is
the first thread started by JMeter the value returned will be 1, if second
then 2 and so on.
http://jmeter.apache.org/usermanual/functions.html#__threadNum

If you are using distributed testing the number returned repeats because
the threadNumber function is executed for each server/slave not by the
client/master.
Then, when using distributed testing, the value 1 will be returned for the
very first thread started by each JMeter server/slave, 2 for the second and
so on.
Post by umesh prajapati
${__javaScript(${__threadNum()}*1300)} does this means number of threads *
1300?
Post by umesh prajapati
Using this approach too,
it only completes 25 transaction per min when it is suppose to do 33
transaction per min.
So, I just changed the value in constant timer.
From: ${__javaScript(${__threadNum()}*1818)}
To: ${__javaScript(${__threadNum()}*1300)}
Post by Flavio Cysne
Post by umesh prajapati
Its not stopping after 60 seconds. Is it because of loop count
forever.
Post by umesh prajapati
Post by Flavio Cysne
yes, with this new approach you'll need Loop forever no more. Just let loop
count at 1.
Runtime Controller will "loop" all requests inside it until the
configured
Post by umesh prajapati
Post by Flavio Cysne
time has gone.
Note that script execution time could be greater than the configured
time
Post by umesh prajapati
Post by Flavio Cysne
because Runtime Controller will start new threads within the time
configured and these started threads will run until the last request.
guru
2013-08-29 02:22:19 UTC
Permalink
Thread Group:5
Ramp up:0
Loop :forever

Schedular: 1hr

Syncrhonizing timer: 5
constant timer:${__javaScript(${__threadNum()}*600)}

With this configuration it is not making 100 calls per minute.

I thought 60,000/100= 600ms (I was assuming it should make 100 calls per
minute) but it is hardly making even 30 calls per minutes. sometime it makes
50, sometimes 10, 30 and so on.





--
View this message in context: http://jmeter.512774.n5.nabble.com/Loop-Count-vs-Number-of-Threads-tp3272154p5718025.html
Sent from the JMeter - User mailing list archive at Nabble.com.

Loading...