]> git.kaiwu.me - haproxy.git/commit
[MINOR] acl: add new keyword "connslots"
authorJeffrey 'jf' Lim <jfs.world@gmail.com>
Wed, 3 Sep 2008 17:03:03 +0000 (01:03 +0800)
committerWilly Tarreau <w@1wt.eu>
Sun, 7 Dec 2008 22:14:01 +0000 (23:14 +0100)
commit5051d7bffcab40564d6c508f3ddc6930a944dbb4
treee4fe1e31ffc0a9f27494fc5ff885c260b2358706
parent3dfe6cd0951a496c251a68a1b6c18157b1d5cbaf
[MINOR] acl: add new keyword "connslots"

I'm in the process of setting up one haproxy instance now, and I find
the following acl option useful. I'm not too sure why this option has
not been available before, but I find this useful for my own usage, so
I'm submitting this patch in the hope that it will be useful as well.

The basic idea is to be able to measure the available connection slots
still available (connection, + queue) - anything beyond that can be
redirected to a different backend. 'connslots' = number of available
server connection slots, + number of available server queue slots. In
the case where we encounter srv maxconn = 0, or srv maxqueue = 0 (in
which case we dont need to care about connslots) the value you get is
-1. Note also that this code does not take care of dynamic connections
at this point in time.

The reason why I'm using this new acl (as opposed to 'nbsrv') is that
'nbsrv' only measures servers that are actually *down*. Whereas this
other acl is more fine-grained, and looks into the number of conn
slots available as well.
doc/configuration.txt
src/backend.c