Re: Concurrent Connections
Joan Picanyol i Puig <[email protected]> Thu, 27 Nov 2014 00:22:14 +0100
| Newsgroups | gmane.comp.java.grinder.user |
|---|---|
| Message-ID | <[email protected]> |
* Gary Mulder <[email protected]> [20141125 21:14]: > On 25 November 2014 at 19:46, Zulu Zulu <[email protected]> wrote: > > > Hi, > > > > When I captured the requests of my web app using TCPProxy, for some pages > > there was a bunch of requests for resource files along with other requests. > > In a real browser, these requests for resource files will be downloaded > > concurrently. But the recorded scripts sends these scripts serially one by > > one. Is it possible to instruct Grinder to make some of these requests > > concurrently just like a real browser? > > > > Short answer: Not out of the box. > > You're going to have to simulate concurrency using multiple threads, just > as the browser does to eliminate the serial nature of the playback. > > You can reasonably assume that if you have enough threads all playing back > the same recording in multiple different sessions there will be concurrent > requests for the resources, but across multiple sessions rather than within > a single session. This is not perfectly realistic, but probably will be > good enough for most testing purposes. > > If you really need the same session to generate concurrent requests then it > is a bit more complex. You'll likely need to split the recording into > concurrent sub-recordings that can be executed across concurrent Grinder > threads using something like > http://grinder.sourceforge.net/g3/script-gallery.html#parallel.py. Any > shared state (i.e. the session id) will need to be passed to all the > Grinder threads that are running the sub-recordings. I've just been hit by this: grinder was masking real concurrency which was not properly serialized in the database (thank asynchronous IO web frameworks) I'm now thinking about how to build a more accurate simulator. Given a TCPProxy recording I can reasonably infer which requests are likely to be actually parallelized by the browser looking at the sleep times, and then I'd need to group request & pages and combine the parallel.py example with the sequence one. However, this sounds like an onerous and hardly reusable task. How is people doing this? Any pointers to tricks or other tools to get the job done? tks -- pica ------------------------------------------------------------------------------ Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration & more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk