You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by "Brown, Alan" <Al...@mentor.com> on 2016/02/18 16:38:43 UTC

Separate User Processes?

Hello Everyone,

My name is Alan and I'm working for a company that is developing a server software. We've been working on this for a long time, longer than I've been working here, but recently we upgraded it to run Java 8. Our old testing tools are not compatible with Java 8 so we've had to switch over to using Jmeter. So far I have to say that I really like Jmeter, but there's one little problem, and that is that we are having trouble getting multiple users to log in to the server. Creating the users is easy, especially with Jmeter's GUI, but we are having difficulty getting them to log in to our server. 

The way it works is that our server assigns a separate "session token" to each user upon login and duplicate tokens are not allowed. It expects each user to be a process on its own, meaning that if the same process creates multiple virtual users, only one of those users will be able to log in because after the first one, all the other virtual users will have the same token. 

So my question to all of you is, do you know of some way to ensure that each user thread created by Jmeter will be its own separate process, completely distinct from the other threads? Is there some plugin that would help us accomplish this? We need some way of converting each thread to be a separate process. Has anyone else encountered this issue when using Jmeter to test their software?

Regards,
Alan Brown

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


RE: Separate User Processes?

Posted by "Brown, Alan" <Al...@mentor.com>.
Hi all,

We do need separate processes for each user so that each user is seen as a separate session. We've looked into the multiple JMeter scripts idea and we've ended up deciding that it would be more efficient to create some kind of wrapper script in Java where each thread calls this wrapper as a java sampler, but then the wrapper will start a different process to call our pre-existing performance tests, which exist as jar files. We mostly just need Jmeter to create users and manage the data; the "test" part is already taken care of. 

We're in the process of implementing this new solution, but I think we are on the right track. Thank you all for your support. If you don't hear back from me in the next couple of days, assume that I was successful. 

Thanks,
Alan

-----Original Message-----
From: Ha Pham [mailto:ha.pham@novobi.com] 
Sent: Thursday, February 18, 2016 1:56 PM
To: JMeter Users List
Subject: Re: Separate User Processes?

Flavio and Alan,

Not sure if I misunderstood what Alan wants to achieve but each virtual JMeter user has a separate thread (~process) so if you set JMeter to have 2 concurrent users, by default web server will consider those are 2 separate users and will assign 2 different sessions UNLESS your web server was built to assign session based on IP (rarely happen) because in that case both users will have the same IP so will have an issue. You can verify this by enable View Result Tree and see different JSESSIONIDs (which is the token the server sends back to JMeter so that JMeter automatically sends it in subsequent requests for the server to associate the server-side session to the correct user) for different users.

1 JMeter can easily create hundreds of concurrent users with couple GB RAM.
It only uses significant memory if you enable heavy plugins e.g. View Result Tree. Maybe I miss something but I don't really see the need to run many JMeter scripts and each has only 1 user. The startup/shutdown process is more expensive than adding another concurrent user to an existing JMeter and that may affect the collected metrics.

Flavio is correct that tokens are typically cookies, however, token can also be embedded in the response from servers.  If it's cookie, Cookie Manager will handle it automatically for you (stores in local and sends in future requests). If tokens are embedded in response from servers, you will need to parse the response to retrieve tokens and send them along in future requests.

Hope can help

-Ha Pham
www.novobi.com

On Thu, Feb 18, 2016 at 10:53 AM, Brown, Alan <Al...@mentor.com> wrote:

> Flavio,
>
> Thank you for your response. We have multiple test machines set aside 
> specifically for generating users, since that's how we did it back 
> when we used HP Performance Center. Also, since we are concerned with 
> server-side data moreso than client-side data, most of our test 
> information is coming from the PerfMon agent plugin on the server 
> machine. So, having multiple logs on the client side shouldn't trouble 
> us too much although it will be rather messy.
>
> We'll experiment with the repeated command line method and get back to you.
>
> Thanks,
> Alan
>
> -----Original Message-----
> From: Flavio Cysne [mailto:flaviocysne@gmail.com]
> Sent: Thursday, February 18, 2016 10:42 AM
> To: JMeter Users List
> Subject: Re: Separate User Processes?
>
> Maybe I have misunderstood your question, but remember that each Java 
> process will allocate some memory and it stacks for each Java process 
> you create. Unless you have a huge amount of memory at your disposal, 
> this is not advisable.
>
> Said that, you could repeat a command line, that executes a JMeter 
> script with only one user, as many times as the desired number of simulated users.
> Log files must be unique and you'll have to process them after the 
> test to get a full view of all your processes.
>
> In any case, Tokens are commonly set as Cookie parameters and a HTTP 
> Cookie Manager have to be added to your script.
>
> If your token is validated as a Header Parameter maybe you'll have to 
> add its entry manually. Using the HTTP(S) Test Script Recorder to 
> record all steps will indicate this if it adds automatically an HTTP 
> Authorization Manager (I have experienced this when response header contains a Set-Token:
> clause)
>
> I hope I helped more then confused.
>

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

Re: Separate User Processes?

Posted by Ha Pham <ha...@novobi.com>.
Flavio and Alan,

Not sure if I misunderstood what Alan wants to achieve but each virtual
JMeter user has a separate thread (~process) so if you set JMeter to have 2
concurrent users, by default web server will consider those are 2 separate
users and will assign 2 different sessions UNLESS your web server was built
to assign session based on IP (rarely happen) because in that case both
users will have the same IP so will have an issue. You can verify this by
enable View Result Tree and see different JSESSIONIDs (which is the token
the server sends back to JMeter so that JMeter automatically sends it in
subsequent requests for the server to associate the server-side session to
the correct user) for different users.

1 JMeter can easily create hundreds of concurrent users with couple GB RAM.
It only uses significant memory if you enable heavy plugins e.g. View
Result Tree. Maybe I miss something but I don't really see the need to run
many JMeter scripts and each has only 1 user. The startup/shutdown process
is more expensive than adding another concurrent user to an existing JMeter
and that may affect the collected metrics.

Flavio is correct that tokens are typically cookies, however, token can
also be embedded in the response from servers.  If it's cookie, Cookie
Manager will handle it automatically for you (stores in local and sends in
future requests). If tokens are embedded in response from servers, you will
need to parse the response to retrieve tokens and send them along in future
requests.

Hope can help

-Ha Pham
www.novobi.com

On Thu, Feb 18, 2016 at 10:53 AM, Brown, Alan <Al...@mentor.com> wrote:

> Flavio,
>
> Thank you for your response. We have multiple test machines set aside
> specifically for generating users, since that's how we did it back when we
> used HP Performance Center. Also, since we are concerned with server-side
> data moreso than client-side data, most of our test information is coming
> from the PerfMon agent plugin on the server machine. So, having multiple
> logs on the client side shouldn't trouble us too much although it will be
> rather messy.
>
> We'll experiment with the repeated command line method and get back to you.
>
> Thanks,
> Alan
>
> -----Original Message-----
> From: Flavio Cysne [mailto:flaviocysne@gmail.com]
> Sent: Thursday, February 18, 2016 10:42 AM
> To: JMeter Users List
> Subject: Re: Separate User Processes?
>
> Maybe I have misunderstood your question, but remember that each Java
> process will allocate some memory and it stacks for each Java process you
> create. Unless you have a huge amount of memory at your disposal, this is
> not advisable.
>
> Said that, you could repeat a command line, that executes a JMeter script
> with only one user, as many times as the desired number of simulated users.
> Log files must be unique and you'll have to process them after the test to
> get a full view of all your processes.
>
> In any case, Tokens are commonly set as Cookie parameters and a HTTP
> Cookie Manager have to be added to your script.
>
> If your token is validated as a Header Parameter maybe you'll have to add
> its entry manually. Using the HTTP(S) Test Script Recorder to record all
> steps will indicate this if it adds automatically an HTTP Authorization
> Manager (I have experienced this when response header contains a Set-Token:
> clause)
>
> I hope I helped more then confused.
>

RE: Separate User Processes?

Posted by "Brown, Alan" <Al...@mentor.com>.
Flavio, 

Thank you for your response. We have multiple test machines set aside specifically for generating users, since that's how we did it back when we used HP Performance Center. Also, since we are concerned with server-side data moreso than client-side data, most of our test information is coming from the PerfMon agent plugin on the server machine. So, having multiple logs on the client side shouldn't trouble us too much although it will be rather messy. 

We'll experiment with the repeated command line method and get back to you. 

Thanks,
Alan

-----Original Message-----
From: Flavio Cysne [mailto:flaviocysne@gmail.com] 
Sent: Thursday, February 18, 2016 10:42 AM
To: JMeter Users List
Subject: Re: Separate User Processes?

Maybe I have misunderstood your question, but remember that each Java process will allocate some memory and it stacks for each Java process you create. Unless you have a huge amount of memory at your disposal, this is not advisable.

Said that, you could repeat a command line, that executes a JMeter script with only one user, as many times as the desired number of simulated users.
Log files must be unique and you'll have to process them after the test to get a full view of all your processes.

In any case, Tokens are commonly set as Cookie parameters and a HTTP Cookie Manager have to be added to your script.

If your token is validated as a Header Parameter maybe you'll have to add its entry manually. Using the HTTP(S) Test Script Recorder to record all steps will indicate this if it adds automatically an HTTP Authorization Manager (I have experienced this when response header contains a Set-Token:
clause)

I hope I helped more then confused.

Re: Separate User Processes?

Posted by Flavio Cysne <fl...@gmail.com>.
Maybe I have misunderstood your question, but remember that each Java
process will allocate some memory and it stacks for each Java process you
create. Unless you have a huge amount of memory at your disposal, this is
not advisable.

Said that, you could repeat a command line, that executes a JMeter script
with only one user, as many times as the desired number of simulated users.
Log files must be unique and you'll have to process them after the test to
get a full view of all your processes.

In any case, Tokens are commonly set as Cookie parameters and a HTTP Cookie
Manager have to be added to your script.

If your token is validated as a Header Parameter maybe you'll have to add
its entry manually. Using the HTTP(S) Test Script Recorder to record all
steps will indicate this if it adds automatically an HTTP Authorization
Manager (I have experienced this when response header contains a Set-Token:
clause)

I hope I helped more then confused.

Re: Separate User Processes?

Posted by Ha Pham <ha...@novobi.com>.
Alan

I believe that could be achieved by a Pre and/or Post Processor to extract
session token from the first response and send it along in subsequent
requests. The first screenshot below is an example to extract transaction
ID and the 2nd screenshot is to send that ID in the next request. If you
need further help, please send me a private email.

[image: Inline image 1]
[image: Inline image 2]

Regards,
-Ha Pham
www.novobi.com

On Thu, Feb 18, 2016 at 9:38 AM, Brown, Alan <Al...@mentor.com> wrote:

> Hello Everyone,
>
> My name is Alan and I'm working for a company that is developing a server
> software. We've been working on this for a long time, longer than I've been
> working here, but recently we upgraded it to run Java 8. Our old testing
> tools are not compatible with Java 8 so we've had to switch over to using
> Jmeter. So far I have to say that I really like Jmeter, but there's one
> little problem, and that is that we are having trouble getting multiple
> users to log in to the server. Creating the users is easy, especially with
> Jmeter's GUI, but we are having difficulty getting them to log in to our
> server.
>
> The way it works is that our server assigns a separate "session token" to
> each user upon login and duplicate tokens are not allowed. It expects each
> user to be a process on its own, meaning that if the same process creates
> multiple virtual users, only one of those users will be able to log in
> because after the first one, all the other virtual users will have the same
> token.
>
> So my question to all of you is, do you know of some way to ensure that
> each user thread created by Jmeter will be its own separate process,
> completely distinct from the other threads? Is there some plugin that would
> help us accomplish this? We need some way of converting each thread to be a
> separate process. Has anyone else encountered this issue when using Jmeter
> to test their software?
>
> Regards,
> Alan Brown
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>