You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Sergei Riaguzov <ri...@gmail.com> on 2005/07/27 18:12:27 UTC

HttpSample2..

I'm sorry for the previous message. Something has screwed in my
head and the border between languages dissapeared. :)

I have some questions about the HttpSampler2.

1. What is his status? He uses HttpClient and is very fast but
do you reccomend its usage in production environment? What should
be done to make it stable? What does it lack?

2. Is there any way except changing the source to specify that if
not needed HttpSampler2 should not download all the ResponseBody
to to somewhere and keep it for some long time? It's been noticed
that when there are many threads working concurrently there may
become a problem with big web pages.. Is there a way to get only
response size and other information and to discard response body
immediatly? Or even better - not to download it in HttpClient to
the memory but use some cycle buffor?

3. Is there an easy way to specify the IP addres for each sample?
For many samples?

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


Re: HttpSample2..

Posted by Sergei Riaguzov <ri...@gmail.com>.
On 7/27/05, Sergei Riaguzov <ri...@gmail.com> wrote:

> 3. Is there an easy way to specify the IP addres for each sample?
> For many samples?
I meant the source IP addres (the address of the "user" sended the request).

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


Re: HttpSample2..

Posted by Peter Lin <wo...@gmail.com>.
the only real reason is that no one bothered to change it. I will
change it from "alpha" to normal for the final release of 2.1.

peter


On 7/27/05, Sergei Riaguzov <ri...@gmail.com> wrote:
> On 7/27/05, Michael Stover <ms...@apache.org> wrote:
> 
> > It's been around for a while - I would say it's probably time to start
> > using the HttpSampler2 in production settings.
> But is it stable? What does it lack to stop being alpha version?
> 
> > If you don't use a listener that stores the response, the response will
> > be discarded pretty quick.
> I've looked quickly into the code and it seems that HttpSampleResult
> or some similar class (I don't remember the name right now) object
> which is saved in JMeterThread is then given as a parameter to
> notifyListeners() and some other methods. I also found out that there
> is always a previous HttpSampleResult saved in threadContext - why?
> 
> All the responseBody is taken by httpMethod.getResponseBody() and then
> given as a
> parameter to HttpSampleResult.setResponseData() as an array of bytes.
> In SizeAssertion the size of the data is checked as this array length.
> 
> And it appears that this bunch of data in HttpSampleResult (this array
> of bytes with response) may be providing to memory usage when there
> are about 1000 thread downloading a page of 50 Kb simultaniously for
> example.
> 
> Do you think that changing it a little may improve memory usage? Maybe
> it would make sense to remove all the links to this data as soon as
> possible if there's no need in regular expressions checking and
> listeners like that?
> 
> > JMeter does not do IP spoofing.
> Thanx for the answer.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org
> 
>

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


Re: HttpSample2..

Posted by Peter Lin <wo...@gmail.com>.
you can look at the webserviceSampler for reference also.  the
webserviceSampler is rather heavy weight due to DOM, so it has the
option of reading the input stream, but doing nothing with it.

:)

peter


On 7/27/05, Sergei Riaguzov <ri...@gmail.com> wrote:
> On 7/27/05, Michael Stover <ms...@apache.org> wrote:
> 
> > Sounds like you want an HttpSampler that throws away the bytes before
> > saving it into the SampleResult.  Making such a thing would be as simple
> > as subclassing the current samplers and overriding the method that
> > downloads the bytes.  Instead of storing it in an adequately sized byte
> > array, throw the bytes out and only return a byte array of the last 100
> > bytes or something.
> Yes looks like that's a solution. And maybe throwing away previous
> HttpSampleResult object in threadContext... I only hope not to get
> lost in the code and find out what listener uppon what fields of this
> result are making what decisions... ;)
> 
> And thanks for your answers! I would also find any ideas about
> improving this sampler perfomance under heavy threads very useful!
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org
> 
>

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


Re: HttpSample2..

Posted by Sergei Riaguzov <ri...@gmail.com>.
On 7/27/05, Michael Stover <ms...@apache.org> wrote:

> Sounds like you want an HttpSampler that throws away the bytes before
> saving it into the SampleResult.  Making such a thing would be as simple
> as subclassing the current samplers and overriding the method that
> downloads the bytes.  Instead of storing it in an adequately sized byte
> array, throw the bytes out and only return a byte array of the last 100
> bytes or something.
Yes looks like that's a solution. And maybe throwing away previous
HttpSampleResult object in threadContext... I only hope not to get
lost in the code and find out what listener uppon what fields of this
result are making what decisions... ;)

And thanks for your answers! I would also find any ideas about
improving this sampler perfomance under heavy threads very useful!

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


Re: HttpSample2..

Posted by Michael Stover <ms...@apache.org>.
Sounds like you want an HttpSampler that throws away the bytes before
saving it into the SampleResult.  Making such a thing would be as simple
as subclassing the current samplers and overriding the method that
downloads the bytes.  Instead of storing it in an adequately sized byte
array, throw the bytes out and only return a byte array of the last 100
bytes or something.

-Mike

On Wed, 2005-07-27 at 20:50 +0200, Sergei Riaguzov wrote:
> On 7/27/05, Michael Stover <ms...@apache.org> wrote:
> 
> > > > It's been around for a while - I would say it's probably time to start
> > > > using the HttpSampler2 in production settings.
> > > But is it stable? What does it lack to stop being alpha version?
> > 
> > It lacks someone making an executive decision to change the name.
> That a very inspirational news. :)
> 
> > > Do you think that changing it a little may improve memory usage? Maybe
> > > it would make sense to remove all the links to this data as soon as
> > > possible if there's no need in regular expressions checking and
> > > listeners like that?
> > throwing away data or never downloading it would surely save on memory,
> > but that data is very often used 
> Yes, that's true - but maybe it won't be too hard to modify some
> listeners and write MyHttpSampler2 or smth like that.. The idea is -
> that mostly there is no need in such assertions as regular expression
> checkings, some compilcated logics based on previos responds...
> 
> >- either to check it against
> > assertions, or to parse information from it for the next sample.
> Acha, that's why the previous one is saved.. To make some decisions upon it?...
> 
> >  Also,
> > actually downloading every byte is an important part of the process, in
> > terms of performance testing. 
> Yes, but I'm thinking about freeing all the links to this array of
> bytes as soon as possible for garbage collector being able to free the
> memory.
> 
> > 1000 threads is probably beyond the reach
> > of most client machines.
> Well on P4 with 1.5 Gb of RAM and Linux with 2.6.8 kernel it appeared
> to be possible. Someone tested it and afaik it worked. I think that
> even more threads in JMeter are possible simultaniously if not that
> memory usage issue...
> 
> A simple Java application is able to generate about 5-7 thousands of
> threads with Java 1.5 and this configuration.
> 
> PS Maybe you can give some advices how to improve JMeters behaviour in
> thousands of threads working alltogether situation?
> 
> PPS Thank you for your answers!
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org
> 


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


Re: HttpSample2..

Posted by Sergei Riaguzov <ri...@gmail.com>.
On 7/27/05, Michael Stover <ms...@apache.org> wrote:

> > > It's been around for a while - I would say it's probably time to start
> > > using the HttpSampler2 in production settings.
> > But is it stable? What does it lack to stop being alpha version?
> 
> It lacks someone making an executive decision to change the name.
That a very inspirational news. :)

> > Do you think that changing it a little may improve memory usage? Maybe
> > it would make sense to remove all the links to this data as soon as
> > possible if there's no need in regular expressions checking and
> > listeners like that?
> throwing away data or never downloading it would surely save on memory,
> but that data is very often used 
Yes, that's true - but maybe it won't be too hard to modify some
listeners and write MyHttpSampler2 or smth like that.. The idea is -
that mostly there is no need in such assertions as regular expression
checkings, some compilcated logics based on previos responds...

>- either to check it against
> assertions, or to parse information from it for the next sample.
Acha, that's why the previous one is saved.. To make some decisions upon it?...

>  Also,
> actually downloading every byte is an important part of the process, in
> terms of performance testing. 
Yes, but I'm thinking about freeing all the links to this array of
bytes as soon as possible for garbage collector being able to free the
memory.

> 1000 threads is probably beyond the reach
> of most client machines.
Well on P4 with 1.5 Gb of RAM and Linux with 2.6.8 kernel it appeared
to be possible. Someone tested it and afaik it worked. I think that
even more threads in JMeter are possible simultaniously if not that
memory usage issue...

A simple Java application is able to generate about 5-7 thousands of
threads with Java 1.5 and this configuration.

PS Maybe you can give some advices how to improve JMeters behaviour in
thousands of threads working alltogether situation?

PPS Thank you for your answers!

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


Re: HttpSample2..

Posted by Michael Stover <ms...@apache.org>.
On Wed, 2005-07-27 at 20:19 +0200, Sergei Riaguzov wrote:
> On 7/27/05, Michael Stover <ms...@apache.org> wrote:
> 
> > It's been around for a while - I would say it's probably time to start
> > using the HttpSampler2 in production settings.
> But is it stable? What does it lack to stop being alpha version?

It lacks someone making an executive decision to change the name.
>  
> > If you don't use a listener that stores the response, the response will
> > be discarded pretty quick.
> I've looked quickly into the code and it seems that HttpSampleResult
> or some similar class (I don't remember the name right now) object
> which is saved in JMeterThread is then given as a parameter to
> notifyListeners() and some other methods. I also found out that there
> is always a previous HttpSampleResult saved in threadContext - why?
> 
> All the responseBody is taken by httpMethod.getResponseBody() and then
> given as a
> parameter to HttpSampleResult.setResponseData() as an array of bytes.
> In SizeAssertion the size of the data is checked as this array length.
> 
> And it appears that this bunch of data in HttpSampleResult (this array
> of bytes with response) may be providing to memory usage when there
> are about 1000 thread downloading a page of 50 Kb simultaniously for
> example.
> 
> Do you think that changing it a little may improve memory usage? Maybe
> it would make sense to remove all the links to this data as soon as
> possible if there's no need in regular expressions checking and
> listeners like that?

throwing away data or never downloading it would surely save on memory,
but that data is very often used - either to check it against
assertions, or to parse information from it for the next sample.  Also,
actually downloading every byte is an important part of the process, in
terms of performance testing.  1000 threads is probably beyond the reach
of most client machines.

-Mike

> 
> > JMeter does not do IP spoofing.
> Thanx for the answer.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org
> 


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


Re: HttpSample2..

Posted by Sergei Riaguzov <ri...@gmail.com>.
On 7/27/05, Michael Stover <ms...@apache.org> wrote:

> It's been around for a while - I would say it's probably time to start
> using the HttpSampler2 in production settings.
But is it stable? What does it lack to stop being alpha version?
 
> If you don't use a listener that stores the response, the response will
> be discarded pretty quick.
I've looked quickly into the code and it seems that HttpSampleResult
or some similar class (I don't remember the name right now) object
which is saved in JMeterThread is then given as a parameter to
notifyListeners() and some other methods. I also found out that there
is always a previous HttpSampleResult saved in threadContext - why?

All the responseBody is taken by httpMethod.getResponseBody() and then
given as a
parameter to HttpSampleResult.setResponseData() as an array of bytes.
In SizeAssertion the size of the data is checked as this array length.

And it appears that this bunch of data in HttpSampleResult (this array
of bytes with response) may be providing to memory usage when there
are about 1000 thread downloading a page of 50 Kb simultaniously for
example.

Do you think that changing it a little may improve memory usage? Maybe
it would make sense to remove all the links to this data as soon as
possible if there's no need in regular expressions checking and
listeners like that?

> JMeter does not do IP spoofing.
Thanx for the answer.

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


Re: HttpSample2..

Posted by Michael Stover <ms...@apache.org>.
It's been around for a while - I would say it's probably time to start
using the HttpSampler2 in production settings.

If you don't use a listener that stores the response, the response will
be discarded pretty quick.  

JMeter does not do IP spoofing.

-Mike

On Wed, 2005-07-27 at 18:12 +0200, Sergei Riaguzov wrote:
> I'm sorry for the previous message. Something has screwed in my
> head and the border between languages dissapeared. :)
> 
> I have some questions about the HttpSampler2.
> 
> 1. What is his status? He uses HttpClient and is very fast but
> do you reccomend its usage in production environment? What should
> be done to make it stable? What does it lack?
> 
> 2. Is there any way except changing the source to specify that if
> not needed HttpSampler2 should not download all the ResponseBody
> to to somewhere and keep it for some long time? It's been noticed
> that when there are many threads working concurrently there may
> become a problem with big web pages.. Is there a way to get only
> response size and other information and to discard response body
> immediatly? Or even better - not to download it in HttpClient to
> the memory but use some cycle buffor?
> 
> 3. Is there an easy way to specify the IP addres for each sample?
> For many samples?
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org



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


Re: HttpSample2..

Posted by Sergei Riaguzov <ri...@gmail.com>.
On 7/27/05, Sergei Riaguzov <ri...@gmail.com> wrote:

> 3. Is there an easy way to specify the IP addres for each sample?
> For many samples?
I meant the source IP addres (the address of the "user" sended the request).

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