Re: request prioritization

From: Jaroslav Gresula <jgresula.LEAVE-THIS-OUT#gmail.com>
Date: Wed, 16 Dec 2009 00:31:31 +0100


Willy Tarreau wrote:
> Hello,
>
> On Tue, Dec 15, 2009 at 10:04:10PM +0100, Jaroslav Gresula wrote:
>> Hello,
>>
>> I use a haproxy queue in front of a server which serves two classes of
>> requests. The two classes - let's call them A and B - can be matched
>> using ACLs.
>>
>> My question is whether it is possible to instruct haproxy to dequeue
>> class A requests with higher priority than class B requests?
>

[ .. ]

> You can then proceed that way :
>
> frontend www
> acl has_basket hdr_sub(cookie) -i BASKET=
> use_backend slow if has_basket
> default_backend fast
>
> backend fast
> server www1 1.1.1.1:80 maxconn 90
>
> backend slow
> server www1 1.1.1.1:80 maxconn 10
>
> See ? When the clients passing through backend "fast" will share 90
> possible connections to the server, the ones through backend "slow"
> will only share 10 connections.
>

[ .. ]

> Hoping it matches your needs,
> Willy

Willy,

that's actually a very good solution for me. A genuine priority queue would not dequeue lower priority requests if there is a flood of high priority ones. Your solution scales better in such case.

I really appreciate your help.

Thanks,

-- 
Jarda
http://jagpdf.org
Received on 2009/12/16 00:31

This archive was generated by hypermail 2.2.0 : 2009/12/16 00:45 CET