You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Mathias Peters <em...@gmx.net> on 2004/09/22 14:56:05 UTC

concurrent thread

Hi to everybody,

I have problems testing a webapp with multiple users and concurrent 
threads.
I have a testplan, where I use several users that must complete "their 
thread" before a new thread with this user starts. Each thread looks like:
1.user logs in
2.user performs subscribe action(if a user is subscribed, he can't 
subscribe another time)
3.user performs unsubscribe
4.user logs out

The crux is, that - then scaling the number of threads of this thread 
group - i need to assure that a new thread for user x can only start 
after this users has unsubscribed in all "his previous threads".
The number of users is variable, so I can't use several thread groups.
Question:
Is there a way to assure that a thread of user x start only when all his 
other threads are finished?
I'm thinking a some kind of lock...

thank you
Matze

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


Re: concurrent thread

Posted by sebb <se...@gmail.com>.
How about extracting the users and passwords in a separate job,
creating suitable input files from it, and then running the student
test separately?

If you run each student thread once, it can pick up the next entries
from the file at the start of the run, e.g.

Thread Group, loops 1, threads=student count
- Get Parameters and save in variables
[Might need to use dummy smpler here to ensure the Pre-processor is run]
- Loop controller
- - Login
- - Processing (could be in loop controller)
- - Logout

S.
On Wed, 22 Sep 2004 16:33:48 +0200, Mathias Peters <em...@gmx.net> wrote:
> it is known in advance, but it may change from test to test.
> the first part of the test logs in the admin-user and extracts all the
> username/pw-kombinations of a special  type of user.
> then a for-each-controller uses these kombinations to perform the
> actions 1-4 as described above.
> all this is done in one thread.
> if I scale the number of threads then it may happen that studentA's
> second "run" starts before studentA has unsubscribed in his first "run".
> If that situation produced only one error message, i could live with
> that and simply ignore the error message.
> Unfortunatly, after the ocurring error the studentA gets kicked out of
> his session, so he can't complete his run and - even worse - all his
> future runs will fail too...
> 
> 
> 
> sebb wrote:
> 
> >Not sure I understand how the web-app works ...
> >
> >Does the number of users change during the run then?
> >
> >Or is it known in advance?
> >It's quite easy to create a test plan with N threads and define N as a
> >command-line property. Likewise for ramp-up, loops etc.
> >
> >S.
> >On Wed, 22 Sep 2004 15:22:23 +0200, Mathias Peters <em...@gmx.net> wrote:
> >
> >
> >>no, unfortunatly I don't know the exakt number of users. I extract them
> >>via regexpr.
> >>
> >>
> >>
> >>sebb wrote:
> >>
> >>
> >>
> >>>Can't you use a separate thread for each user?
> >>>
> >>>S.
> >>>
> >>>On Wed, 22 Sep 2004 14:56:05 +0200, Mathias Peters <em...@gmx.net> wrote:
> >>>
> >>>
> >>>
> >>>
> >>>>Hi to everybody,
> >>>>
> >>>>I have problems testing a webapp with multiple users and concurrent
> >>>>threads.
> >>>>I have a testplan, where I use several users that must complete "their
> >>>>thread" before a new thread with this user starts. Each thread looks like:
> >>>>1.user logs in
> >>>>2.user performs subscribe action(if a user is subscribed, he can't
> >>>>subscribe another time)
> >>>>3.user performs unsubscribe
> >>>>4.user logs out
> >>>>
> >>>>The crux is, that - then scaling the number of threads of this thread
> >>>>group - i need to assure that a new thread for user x can only start
> >>>>after this users has unsubscribed in all "his previous threads".
> >>>>The number of users is variable, so I can't use several thread groups.
> >>>>Question:
> >>>>Is there a way to assure that a thread of user x start only when all his
> >>>>other threads are finished?
> >>>>I'm thinking a some kind of lock...
> >>>>
> >>>>thank you
> >>>>Matze
> >>>>
> >>>>---------------------------------------------------------------------
> >>>>To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> >>>>For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>---------------------------------------------------------------------
> >>>To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> >>>For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> >>For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> >>
> >>
> >>
> >>
> >
> >---------------------------------------------------------------------
> 
> 
> >To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> >
> >
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> 
>

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


Re: concurrent thread

Posted by Mathias Peters <em...@gmx.net>.
it is known in advance, but it may change from test to test.
the first part of the test logs in the admin-user and extracts all the 
username/pw-kombinations of a special  type of user.
then a for-each-controller uses these kombinations to perform the 
actions 1-4 as described above.
all this is done in one thread.
if I scale the number of threads then it may happen that studentA's 
second "run" starts before studentA has unsubscribed in his first "run".
If that situation produced only one error message, i could live with 
that and simply ignore the error message.
Unfortunatly, after the ocurring error the studentA gets kicked out of 
his session, so he can't complete his run and - even worse - all his 
future runs will fail too...

sebb wrote:

>Not sure I understand how the web-app works ...
>
>Does the number of users change during the run then? 
>
>Or is it known in advance?
>It's quite easy to create a test plan with N threads and define N as a
>command-line property. Likewise for ramp-up, loops etc.
>
>S.
>On Wed, 22 Sep 2004 15:22:23 +0200, Mathias Peters <em...@gmx.net> wrote:
>  
>
>>no, unfortunatly I don't know the exakt number of users. I extract them
>>via regexpr.
>>
>>
>>
>>sebb wrote:
>>
>>    
>>
>>>Can't you use a separate thread for each user?
>>>
>>>S.
>>>
>>>On Wed, 22 Sep 2004 14:56:05 +0200, Mathias Peters <em...@gmx.net> wrote:
>>>
>>>
>>>      
>>>
>>>>Hi to everybody,
>>>>
>>>>I have problems testing a webapp with multiple users and concurrent
>>>>threads.
>>>>I have a testplan, where I use several users that must complete "their
>>>>thread" before a new thread with this user starts. Each thread looks like:
>>>>1.user logs in
>>>>2.user performs subscribe action(if a user is subscribed, he can't
>>>>subscribe another time)
>>>>3.user performs unsubscribe
>>>>4.user logs out
>>>>
>>>>The crux is, that - then scaling the number of threads of this thread
>>>>group - i need to assure that a new thread for user x can only start
>>>>after this users has unsubscribed in all "his previous threads".
>>>>The number of users is variable, so I can't use several thread groups.
>>>>Question:
>>>>Is there a way to assure that a thread of user x start only when all his
>>>>other threads are finished?
>>>>I'm thinking a some kind of lock...
>>>>
>>>>thank you
>>>>Matze
>>>>
>>>>---------------------------------------------------------------------
>>>>To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>>>>For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>>>>
>>>>
>>>>
>>>>
>>>>        
>>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>>>
>>>
>>>
>>>
>>>      
>>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>>
>>
>>    
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>
>  
>


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


Re: concurrent thread

Posted by sebb <se...@gmail.com>.
Not sure I understand how the web-app works ...

Does the number of users change during the run then? 

Or is it known in advance?
It's quite easy to create a test plan with N threads and define N as a
command-line property. Likewise for ramp-up, loops etc.

S.
On Wed, 22 Sep 2004 15:22:23 +0200, Mathias Peters <em...@gmx.net> wrote:
> no, unfortunatly I don't know the exakt number of users. I extract them
> via regexpr.
> 
> 
> 
> sebb wrote:
> 
> >Can't you use a separate thread for each user?
> >
> >S.
> >
> >On Wed, 22 Sep 2004 14:56:05 +0200, Mathias Peters <em...@gmx.net> wrote:
> >
> >
> >>Hi to everybody,
> >>
> >>I have problems testing a webapp with multiple users and concurrent
> >>threads.
> >>I have a testplan, where I use several users that must complete "their
> >>thread" before a new thread with this user starts. Each thread looks like:
> >>1.user logs in
> >>2.user performs subscribe action(if a user is subscribed, he can't
> >>subscribe another time)
> >>3.user performs unsubscribe
> >>4.user logs out
> >>
> >>The crux is, that - then scaling the number of threads of this thread
> >>group - i need to assure that a new thread for user x can only start
> >>after this users has unsubscribed in all "his previous threads".
> >>The number of users is variable, so I can't use several thread groups.
> >>Question:
> >>Is there a way to assure that a thread of user x start only when all his
> >>other threads are finished?
> >>I'm thinking a some kind of lock...
> >>
> >>thank you
> >>Matze
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> >>For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> >>
> >>
> >>
> >>
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> >
> >
> >
> >
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> 
>

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


Re: concurrent thread

Posted by Mathias Peters <em...@gmx.net>.
no, unfortunatly I don't know the exakt number of users. I extract them 
via regexpr.
 
sebb wrote:

>Can't you use a separate thread for each user?
>
>S.
>
>On Wed, 22 Sep 2004 14:56:05 +0200, Mathias Peters <em...@gmx.net> wrote:
>  
>
>>Hi to everybody,
>>
>>I have problems testing a webapp with multiple users and concurrent
>>threads.
>>I have a testplan, where I use several users that must complete "their
>>thread" before a new thread with this user starts. Each thread looks like:
>>1.user logs in
>>2.user performs subscribe action(if a user is subscribed, he can't
>>subscribe another time)
>>3.user performs unsubscribe
>>4.user logs out
>>
>>The crux is, that - then scaling the number of threads of this thread
>>group - i need to assure that a new thread for user x can only start
>>after this users has unsubscribed in all "his previous threads".
>>The number of users is variable, so I can't use several thread groups.
>>Question:
>>Is there a way to assure that a thread of user x start only when all his
>>other threads are finished?
>>I'm thinking a some kind of lock...
>>
>>thank you
>>Matze
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>>
>>
>>    
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>
>  
>


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


Re: concurrent thread

Posted by sebb <se...@gmail.com>.
Can't you use a separate thread for each user?

S.

On Wed, 22 Sep 2004 14:56:05 +0200, Mathias Peters <em...@gmx.net> wrote:
> Hi to everybody,
> 
> I have problems testing a webapp with multiple users and concurrent
> threads.
> I have a testplan, where I use several users that must complete "their
> thread" before a new thread with this user starts. Each thread looks like:
> 1.user logs in
> 2.user performs subscribe action(if a user is subscribed, he can't
> subscribe another time)
> 3.user performs unsubscribe
> 4.user logs out
> 
> The crux is, that - then scaling the number of threads of this thread
> group - i need to assure that a new thread for user x can only start
> after this users has unsubscribed in all "his previous threads".
> The number of users is variable, so I can't use several thread groups.
> Question:
> Is there a way to assure that a thread of user x start only when all his
> other threads are finished?
> I'm thinking a some kind of lock...
> 
> thank you
> Matze
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> 
>

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