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.