You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by ruthm <ru...@gmail.com> on 2012/03/05 11:51:19 UTC

Allowing only one thread to make a request at a time

Is it possible to set up the following scenario using JMeter?

I have 30 users browsing through a site at the same time - I use a
threadgroup with 30 threads to do that. 

There is then one particular http request which i want to synchronize such
that only one user can carry out that request at a time. Is there any
controller that allows me to do this?

Thanks
Ruth

--
View this message in context: http://jmeter.512774.n5.nabble.com/Allowing-only-one-thread-to-make-a-request-at-a-time-tp5537163p5537163.html
Sent from the JMeter - User mailing list archive at Nabble.com.

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


Re: Allowing only one thread to make a request at a time

Posted by Flavio Cysne <fl...@gmail.com>.
Put the sampler you want to have only one user at a time inside a constant
throughtput timer (CTT) and before this add a synchronizing timer, with 30
in "Number of Simultaneous Users to Group by" field. You'll need to
calculate the value of "Target Throughput" field of CTT 'cause it's per
minute. Maybe if your request is too slow you'll need to put a value lower
than 30 in this field.

Hope it helps you.
Flávio Cysne

2012/3/5 ruthm <ru...@gmail.com>

> Is it possible to set up the following scenario using JMeter?
>
> I have 30 users browsing through a site at the same time - I use a
> threadgroup with 30 threads to do that.
>
> There is then one particular http request which i want to synchronize such
> that only one user can carry out that request at a time. Is there any
> controller that allows me to do this?
>
> Thanks
> Ruth
>
> --
> View this message in context:
> http://jmeter.512774.n5.nabble.com/Allowing-only-one-thread-to-make-a-request-at-a-time-tp5537163p5537163.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>

Re: Allowing only one thread to make a request at a time

Posted by Ruth Mizzi <ru...@gmail.com>.
Thanks for the continued thoughts on this thread ...

Just wanted to confirm that this is not something that would be deployed in
a live scenario ...  :)

R
On Tue, Mar 6, 2012 at 6:54 PM, Deepak Shetty <sh...@gmail.com> wrote:

> >I needed  some throughput measures for such a situation.
> If you make requests serially then your throughput is the same as that for
> a single user :).
>
> >I then went for the option of modifying the source code to simulate this
> situation
> You mean the source code of your app? and unless this is the version of the
> code that will finally be deployed it doesnt make sense.
>
> regards
> deepak
>
> On Tue, Mar 6, 2012 at 1:08 AM, Ruth Mizzi <ru...@gmail.com> wrote:
>
> > Thanks for your replies ... I know this was an unrealistic scenario but I
> > needed  some throughput measures for such a situation.
> >
> > Having said that I then went for the option of modifying the source code
> to
> > simulate this situation thus removing any need for special tweaking of
> the
> > JMeter test.
> >
> > Thanks anyway for the help.
> >
> > On Tue, Mar 6, 2012 at 4:50 AM, Deepak Shetty <sh...@gmail.com> wrote:
> >
> > > I'd probably take a look at what you are trying to do - 30 "real" users
> > > wouldnt synchronize access -
> > > and if you expect your app to do the synchronizing then no further
> action
> > > should be needed from Jmeter.
> > >
> > >
> > > On Mon, Mar 5, 2012 at 2:51 AM, ruthm <ru...@gmail.com> wrote:
> > >
> > > > Is it possible to set up the following scenario using JMeter?
> > > >
> > > > I have 30 users browsing through a site at the same time - I use a
> > > > threadgroup with 30 threads to do that.
> > > >
> > > > There is then one particular http request which i want to synchronize
> > > such
> > > > that only one user can carry out that request at a time. Is there any
> > > > controller that allows me to do this?
> > > >
> > > > Thanks
> > > > Ruth
> > > >
> > > > --
> > > > View this message in context:
> > > >
> > >
> >
> http://jmeter.512774.n5.nabble.com/Allowing-only-one-thread-to-make-a-request-at-a-time-tp5537163p5537163.html
> > > > Sent from the JMeter - User mailing list archive at Nabble.com.
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> > > > For additional commands, e-mail: user-help@jmeter.apache.org
> > > >
> > > >
> > >
> >
>

Re: Allowing only one thread to make a request at a time

Posted by Deepak Shetty <sh...@gmail.com>.
>I needed  some throughput measures for such a situation.
If you make requests serially then your throughput is the same as that for
a single user :).

>I then went for the option of modifying the source code to simulate this
situation
You mean the source code of your app? and unless this is the version of the
code that will finally be deployed it doesnt make sense.

regards
deepak

On Tue, Mar 6, 2012 at 1:08 AM, Ruth Mizzi <ru...@gmail.com> wrote:

> Thanks for your replies ... I know this was an unrealistic scenario but I
> needed  some throughput measures for such a situation.
>
> Having said that I then went for the option of modifying the source code to
> simulate this situation thus removing any need for special tweaking of the
> JMeter test.
>
> Thanks anyway for the help.
>
> On Tue, Mar 6, 2012 at 4:50 AM, Deepak Shetty <sh...@gmail.com> wrote:
>
> > I'd probably take a look at what you are trying to do - 30 "real" users
> > wouldnt synchronize access -
> > and if you expect your app to do the synchronizing then no further action
> > should be needed from Jmeter.
> >
> >
> > On Mon, Mar 5, 2012 at 2:51 AM, ruthm <ru...@gmail.com> wrote:
> >
> > > Is it possible to set up the following scenario using JMeter?
> > >
> > > I have 30 users browsing through a site at the same time - I use a
> > > threadgroup with 30 threads to do that.
> > >
> > > There is then one particular http request which i want to synchronize
> > such
> > > that only one user can carry out that request at a time. Is there any
> > > controller that allows me to do this?
> > >
> > > Thanks
> > > Ruth
> > >
> > > --
> > > View this message in context:
> > >
> >
> http://jmeter.512774.n5.nabble.com/Allowing-only-one-thread-to-make-a-request-at-a-time-tp5537163p5537163.html
> > > Sent from the JMeter - User mailing list archive at Nabble.com.
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> > > For additional commands, e-mail: user-help@jmeter.apache.org
> > >
> > >
> >
>

Re: Allowing only one thread to make a request at a time

Posted by Deepak Shetty <sh...@gmail.com>.
> I thought of localized commercials or lucky clicks => only one user gets
there
In which case the scenario is 30 users access the page, extract the link ,
if present click it , if not refresh the page -- do something else etc.
Post validate that only 1 user was presented the link.

And it most such cases (bidding, auctioning , reservation etc type of
websites) - you do actually need to simulate concurrent access - rather
than ensure that the test is sending serial requests.


On Tue, Mar 6, 2012 at 8:24 AM, Adrian Speteanu <as...@gmail.com> wrote:

> Its not necessarily unrealistic. But you have to be careful and think if
> your application actually does that. I thought of localized commercials or
> lucky clicks => only one user gets there, other users get different
> resources, not the same one (and of course they don't synchronize their
> clicks)... if you hard-code that page access in your test, than you need to
> implement this scenario you were describing. If you can dynamically choose
> the page, then it won't make sense to synchronize the users just implement
> your test logic.
>
> Do you know the Synchronizing timer? This is the easiest way to synchronize
> certain actions over multiple threads.
>
>
> On Tue, Mar 6, 2012 at 11:08 AM, Ruth Mizzi <ru...@gmail.com> wrote:
>
> > Thanks for your replies ... I know this was an unrealistic scenario but I
> > needed  some throughput measures for such a situation.
> >
> > Having said that I then went for the option of modifying the source code
> to
> > simulate this situation thus removing any need for special tweaking of
> the
> > JMeter test.
> >
> > Thanks anyway for the help.
> >
> > On Tue, Mar 6, 2012 at 4:50 AM, Deepak Shetty <sh...@gmail.com> wrote:
> >
> > > I'd probably take a look at what you are trying to do - 30 "real" users
> > > wouldnt synchronize access -
> > > and if you expect your app to do the synchronizing then no further
> action
> > > should be needed from Jmeter.
> > >
> > >
> > > On Mon, Mar 5, 2012 at 2:51 AM, ruthm <ru...@gmail.com> wrote:
> > >
> > > > Is it possible to set up the following scenario using JMeter?
> > > >
> > > > I have 30 users browsing through a site at the same time - I use a
> > > > threadgroup with 30 threads to do that.
> > > >
> > > > There is then one particular http request which i want to synchronize
> > > such
> > > > that only one user can carry out that request at a time. Is there any
> > > > controller that allows me to do this?
> > > >
> > > > Thanks
> > > > Ruth
> > > >
> > > > --
> > > > View this message in context:
> > > >
> > >
> >
> http://jmeter.512774.n5.nabble.com/Allowing-only-one-thread-to-make-a-request-at-a-time-tp5537163p5537163.html
> > > > Sent from the JMeter - User mailing list archive at Nabble.com.
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> > > > For additional commands, e-mail: user-help@jmeter.apache.org
> > > >
> > > >
> > >
> >
>

Re: Allowing only one thread to make a request at a time

Posted by Adrian Speteanu <as...@gmail.com>.
Its not necessarily unrealistic. But you have to be careful and think if
your application actually does that. I thought of localized commercials or
lucky clicks => only one user gets there, other users get different
resources, not the same one (and of course they don't synchronize their
clicks)... if you hard-code that page access in your test, than you need to
implement this scenario you were describing. If you can dynamically choose
the page, then it won't make sense to synchronize the users just implement
your test logic.

Do you know the Synchronizing timer? This is the easiest way to synchronize
certain actions over multiple threads.


On Tue, Mar 6, 2012 at 11:08 AM, Ruth Mizzi <ru...@gmail.com> wrote:

> Thanks for your replies ... I know this was an unrealistic scenario but I
> needed  some throughput measures for such a situation.
>
> Having said that I then went for the option of modifying the source code to
> simulate this situation thus removing any need for special tweaking of the
> JMeter test.
>
> Thanks anyway for the help.
>
> On Tue, Mar 6, 2012 at 4:50 AM, Deepak Shetty <sh...@gmail.com> wrote:
>
> > I'd probably take a look at what you are trying to do - 30 "real" users
> > wouldnt synchronize access -
> > and if you expect your app to do the synchronizing then no further action
> > should be needed from Jmeter.
> >
> >
> > On Mon, Mar 5, 2012 at 2:51 AM, ruthm <ru...@gmail.com> wrote:
> >
> > > Is it possible to set up the following scenario using JMeter?
> > >
> > > I have 30 users browsing through a site at the same time - I use a
> > > threadgroup with 30 threads to do that.
> > >
> > > There is then one particular http request which i want to synchronize
> > such
> > > that only one user can carry out that request at a time. Is there any
> > > controller that allows me to do this?
> > >
> > > Thanks
> > > Ruth
> > >
> > > --
> > > View this message in context:
> > >
> >
> http://jmeter.512774.n5.nabble.com/Allowing-only-one-thread-to-make-a-request-at-a-time-tp5537163p5537163.html
> > > Sent from the JMeter - User mailing list archive at Nabble.com.
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> > > For additional commands, e-mail: user-help@jmeter.apache.org
> > >
> > >
> >
>

Re: Allowing only one thread to make a request at a time

Posted by Ruth Mizzi <ru...@gmail.com>.
Thanks for your replies ... I know this was an unrealistic scenario but I
needed  some throughput measures for such a situation.

Having said that I then went for the option of modifying the source code to
simulate this situation thus removing any need for special tweaking of the
JMeter test.

Thanks anyway for the help.

On Tue, Mar 6, 2012 at 4:50 AM, Deepak Shetty <sh...@gmail.com> wrote:

> I'd probably take a look at what you are trying to do - 30 "real" users
> wouldnt synchronize access -
> and if you expect your app to do the synchronizing then no further action
> should be needed from Jmeter.
>
>
> On Mon, Mar 5, 2012 at 2:51 AM, ruthm <ru...@gmail.com> wrote:
>
> > Is it possible to set up the following scenario using JMeter?
> >
> > I have 30 users browsing through a site at the same time - I use a
> > threadgroup with 30 threads to do that.
> >
> > There is then one particular http request which i want to synchronize
> such
> > that only one user can carry out that request at a time. Is there any
> > controller that allows me to do this?
> >
> > Thanks
> > Ruth
> >
> > --
> > View this message in context:
> >
> http://jmeter.512774.n5.nabble.com/Allowing-only-one-thread-to-make-a-request-at-a-time-tp5537163p5537163.html
> > Sent from the JMeter - User mailing list archive at Nabble.com.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> > For additional commands, e-mail: user-help@jmeter.apache.org
> >
> >
>

Re: Allowing only one thread to make a request at a time

Posted by Deepak Shetty <sh...@gmail.com>.
I'd probably take a look at what you are trying to do - 30 "real" users
wouldnt synchronize access -
and if you expect your app to do the synchronizing then no further action
should be needed from Jmeter.


On Mon, Mar 5, 2012 at 2:51 AM, ruthm <ru...@gmail.com> wrote:

> Is it possible to set up the following scenario using JMeter?
>
> I have 30 users browsing through a site at the same time - I use a
> threadgroup with 30 threads to do that.
>
> There is then one particular http request which i want to synchronize such
> that only one user can carry out that request at a time. Is there any
> controller that allows me to do this?
>
> Thanks
> Ruth
>
> --
> View this message in context:
> http://jmeter.512774.n5.nabble.com/Allowing-only-one-thread-to-make-a-request-at-a-time-tp5537163p5537163.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>