in reply to Handling Multi-Priority Requests

I just have one bit of advice.
I wouldn't leap-frog the paid request ahead of all the free ones, because then, under heavy loads, the free requests get completely starved out until all the paid requests have been handled.
Instead, I'd leap-frog each paid request ahead of all but one of the free requests. Then, under a typical heavy load, free and paid requests are popped from the queue in alternating order, but paid requests still get dispatched sooner (i.e. lower queue wait times) than free ones.

(Update) Note that this will only make a difference when the rate of free request generation is significantly greater than the rate of paid request generation.

jdporter
The 6th Rule of Perl Club is -- There is no Rule #6.

Replies are listed 'Best First'.
Re: Re: Handling Multi-Priority Requests
by demerphq (Chancellor) on May 13, 2003 at 16:08 UTC

    Instead, I'd leap-frog each paid request ahead of all but one of the free requests.

    A suprisingly subtle solution to an interesting problem. I like it. ++ to you. I'm actually somewhat suprised I've not heard of this before.


    ---
    demerphq

    <Elian> And I do take a kind of perverse pleasure in having an OO assembly language...
Re: Re: Handling Multi-Priority Requests
by Wibble (Beadle) on May 13, 2003 at 16:17 UTC
    Hmmm - I too hadn't heard of this method of being fair to free requests. I had thought of promoting free requests to paid requests the longer they wait, but this does seem easier. A ++ to you. Thanks for the Tip.