Hi,

I have to manage many parallel HTTP/HTTPS connections. My current implementation starts up a number of threads (300-500). Each thread handles one LWP::UserAgent. Then I use a queue to shift connection requests from the manager thread to the workers.

Since Perl's thread implementation is rather memory consuming this is not the optimal solution. 500 threads is the maximum on my 1GB machine.

I want to change the code to use non-blocking IO and select()ing ready file handles without loosing the comfort of LWP::UserAgent.

What is the best way? Is that feasible with LWP::UserAgent? Is there a better solution to handle many parallel connections? I need HTTP and HTTPS.

Thanks,
Torsten


In reply to managing many parallel HTTP requests by tfoertsch

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.