Unless you run your loadtest script on a machine with 99 processors, you ae not going to hit the server at exactly the same time regardles of whether you use processes or threads of asyncIO.

Of course, even if you had 99 processors, the variablility in network responses, the bottleneck of the tcpip stack and interface card, congestion delays whether floydd or BEB, all mean that you aren't going to hit at exactly the same time.

You would probably need to run 100 "users" on 10 machines for several thousand cycles before you would come close to 100 simultaneous requests, but you're probably more concerned with handling 100 concurrent requests?

This will come close to your requirements. You may need to adjust the delay factor (0.1), to ensure that 100 threads are all spawned and ready to go at the same time. The simple trace will tell you how close to simultaneous the requests were issued. Your log file will tell you the rest. You could also make it so that it would delay to a specified time of day and (provided your network is timesynced), run multiple copies on different machines to get a more realistic test. Anyway, it's a simple starting point.

#! perl -slw use strict; use threads; use Time::HiRes qw[time sleep]; use LWP::Simple; sub hitEm { my( $url, $when ) = @_; sleep $when - time; printf "%3d : %s\n", threads->tid, time; get $url; } my( $users, $url ) = @ARGV; my $when = time + 0.1 * $users; my @users = map{ threads->create( \&hitEm, $url, $when ); } 1 .. $users; sleep $when - time; $_->join for @users; __END__ c:\test>534459 10 http://news.bbc.co.uk/ 5 : 1141489281.46878 6 : 1141489281.46877 7 : 1141489281.46877 10 : 1141489281.46877 8 : 1141489281.48441 9 : 1141489281.48439 3 : 1141489281.48439 1 : 1141489281.4844 2 : 1141489281.48439 4 : 1141489281.4844

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

In reply to Re: Load testing/Simultaneous HTTP requests by BrowserUk
in thread Load testing/Simultaneous HTTP requests by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.