Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Thank you for warm tone of your reply and flattering assumptions about my knowledge.

Actually, I have written some kind of proxy, which uses AE::HTTP for backend querying. There I've met the limitation HTTP::MAX_PER_HOST = 4

You request can't be cancelled inside callback, because it is invoked only after http call (successful or unsuccessful).

I think, I do understand well what is load testing and how AE works. It works in single process CPU thread, that means, that it gets some performance boost only during I/O wait operations via processing or enqueueing other requests. So, might reach the limit of parallel requests much earlier, then you'll get 1000 simultaneously running http requests, due to limitations of the single core CPU. So, perl / AE scheduler might be just overloaded in doing http requests, processing results, and switching between contexts.

It may be better to gradually rise the number of simultaneous http requests. According to that metrics: https://github.com/Mons/AnyEvent-HTTP-Server-II AE::HTTPD (written in similar manner as AE::HTTP), serves only about 560 rps (on single CPU core, as I understand). That explains well, that doing 1000 dummy requests, will load your CPU to 100%.

I can advice you to use ab from apache-tools package for simple load testing, because it is written in C, and aimed for loading.


In reply to Re^3: What's causing the busy wait when using AnyEvent::HTTP by basiliscos
in thread What's causing the busy wait when using AnyEvent::HTTP 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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-04-20 02:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found