West Wind WebSurge
Stagger Thread Start Times
Gravatar is a globally recognized avatar based on your email address. Stagger Thread Start Times
  Graham Richardson
  All
  Feb 4, 2020 @ 01:26am

Is there any way to stagger thread start times?

Maybe using plugin code to provide some sort of wait function when first thread request starts?

Another option maybe to run multiple cli exes at the same time, would that work?

One different question is showing stats based on session rather than request. I am guessing that gathering the information in the plugin would be the only way to do that?

Thanks

Gravatar is a globally recognized avatar based on your email address. re: Stagger Thread Start Times
  Rick Strahl
  Graham Richardson
  Feb 4, 2020 @ 11:53am

Hi Graham,

There's no built-in way to do this but I fail to see how this helps in a load test. If you have any amount of reasonable timeout after a few seconds the threads will diverge anyway unless you're running very short runs.

What scenario do you foresee here? What kind of delay offset? What type of timeout and delay for individual requests?

You can run multiple CLI (or WebSurge UI) instances and that would work to get your offset.

Session based tracking - currently WebSurge doesn't track session id only request ids. That might be a good thing to add, but it's one more thing that would have to be stored with request.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Stagger Thread Start Times
  Graham Richardson
  Rick Strahl
  Feb 5, 2020 @ 12:09am

Thanks Rick,

Should have given you more detail.

Am testing a WebApi that is used for handling mobile synchronisation and for a most of the calls elapsed times is high but the number of calls is low (compared to a high vol. web site). So even when testing running for 10 mins there was some divergence but not much.

At the moment a single session is a complete list of the calls that a single client would make with the parameters fixed. I used the plugin to change the request parameters based on thread number. Selecting a set of parameters that gave different process times for each thread made the divergence happen quicker and gave better load/stress testing as well.

Thanks for your help.

Graham

Gravatar is a globally recognized avatar based on your email address. re: Stagger Thread Start Times
  Rick Strahl
  Graham Richardson
  Feb 5, 2020 @ 12:22am

Ah Ok... I see.

Yeah, that's pretty much what addins are for in WebSurge, so that's a good use of what's available.

If you're already using an addin, it will be pretty easy to create your staggered threads by intercepting the startup and keeping track of the number threads loaded with an Interlocked.Increment() and injecting the appropriate staggering wait time with a Thread.Sleep() for the offset for each thread.

+++ Rick ---

© 1996-2020