Asynchronous HTTP Request Sampler?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Asynchronous HTTP Request Sampler?

developer757
This post has NOT been accepted by the mailing list yet.
Hi, I'm currently executing an Http Request Sampler (GET) in a loop controller/if controller.  This http request takes several minutes to run because it is getting a large amount of data back, and in the meantime, my loop is waiting on the http request to complete and is not iterating.  

Is there any way to send the http request in a new thread to allow the loop to continue to run (apart from putting everything in a Beanshell that starts a new thread?)

I have tried moving the HTTP Request Sampler to a new thread group and using the module controller to call it and it STILL is called synchronously (ie execution waits until the http request returns)

Thanks,

d757
Reply | Threaded
Open this post in threaded view
|

Re: Asynchronous HTTP Request Sampler?

bobMeliev
This post has NOT been accepted by the mailing list yet.
What if you check "Run Thread Groups consecutively" in Test Plan? Did you try?
Reply | Threaded
Open this post in threaded view
|

Re: Asynchronous HTTP Request Sampler?

developer757
This post has NOT been accepted by the mailing list yet.
I tried this and still no luck.  The only thing this seems to do is delay the creation of the second thread, but the first thread still waits on the second thread to finish.
Reply | Threaded
Open this post in threaded view
|

Re: Asynchronous HTTP Request Sampler?

developer757
This post has NOT been accepted by the mailing list yet.
This post was updated on .
In reply to this post by developer757
I tried modifying the JMeter source code to multi-thread my HTTP requests and it turned into a nightmare since the main thread context is not threadsafe.

This seems to be an unfortunate limitation in JMeter.  Guess it's time to look for a different tool.
Reply | Threaded
Open this post in threaded view
|

Re: Asynchronous HTTP Request Sampler?

bobMeliev
This post has NOT been accepted by the mailing list yet.
apc
Reply | Threaded
Open this post in threaded view
|

Re: Asynchronous HTTP Request Sampler?

apc
This post has NOT been accepted by the mailing list yet.
In reply to this post by developer757
Hi,

You can do the trick by using two thread groups and http://jmeter-plugins.org/wiki/InterThreadCommunication/ from custom plugins.

Once your first thread group gets an URL to download, you put it into FIFO queue.
Every thread in second thread group should wait on FIFO preprocessor, waiting for the URL to download.

That's easy and simple. Please, ask for more details, if you didn't catch the idea from my short message.

Good Luck!
--
Andrey Pohilko
JMeter-Plugins.org Maintainer
Reply | Threaded
Open this post in threaded view
|

Re: Asynchronous HTTP Request Sampler?

developer757
This post has NOT been accepted by the mailing list yet.
This post was updated on .
Thanks a lot for the reply.

When you say 'wait on the pre-processor', how exactly is the best way to do that?

I understand that I'll have:

- Thread Group 2
  - Inter-Thread Communication PreProcessor

But do I need a loop or anything to keep checking the queue?

Thanks a lot for the tip!