Hi Monks,

I'm looking for some design oriented "I don't want to re-invent the wheel" type advice. I have a situation where multiple 'producers' on my quick and dirty servers (A,B,C,D,E) send asynchronous HTTP requests to a virtual IP address hosted on a load balancer which distributes the requests fairly across some slow and chunky closed VB 'consumers' on servers (X1, X2, X3, Y1, Y2, Y3, Z1, Z2, Z3). This is all fine and dandy and works a treat with LWP::UserAgent requests.

Whilst those requests are roughly the same, some of them are paid for and some are free. Therefore I would like to prioritise the paid for requests over the free requests - especially when the 'producers' get busy. I have considered dedicating some of the 'consumers' for paid for requests but this is less than efficient and doesn't handle peaks in free/paid request categories very well.

In this Internet age if you can think it then someone has done it, so I naturally thought of Perl. So I did some CPAN searching and came across the POE and POE::Queue::Array modules. I read around a bit on the success stories and examples and these modules look like a great starting point.

One solution, as I see it, is a piece of POE enabled perl-middleware sitting between my 'producers' and the 'consumers' sitting behind the load balanced virtual IP (VIP). The middleware would receive the asynchronous requests into a queue and leapfrog any paid-for requests over any free-requests before sending the requests onto the 'consumers' via the VIP.

Am I right to suspect that this is something that could be built using POE? Are there any Monks out there with any advice either way?

Cheers...


In reply to Handling Multi-Priority Requests by Wibble

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.