Hi All,
We recently used haproxy as the load balancer in our system and
it really worked great. However, we still need one extra feature here.
For every POST request, we want to be able to append an id (or
serial number) to it. Essentially, we are trying to serializing the POST
requests.
For example, for the following POST requests,
a.1) curl -X POST -H 'Content-Type: application/json' -d
'{"key1":"value1"}'
http://localhost:9000/update
a.2) curl -X POST -H 'Content-Type: application/json' -d
'{"key2":"value2"}'
http://localhost:9000/update
a.3) curl -X POST -H 'Content-Type: application/json' -d
'{"key3":"value3"}'
http://localhost:9000/update
What we want is that haproxy could append a serial number to them.
Therefore, they will become
b.1) curl -X POST -H 'Content-Type: application/json' -d
'{"key1":"value1"}'
http://localhost:9000/update/10001
b.2) curl -X POST -H 'Content-Type: application/json' -d
'{"key2":"value2"}'
http://localhost:9000/update/10002
b.3) curl -X POST -H 'Content-Type: application/json' -d
'{"key3":"value3"}'
http://localhost:9000/update/10003
Here, "10001" , "10002" and ""10003" are the serial numbers appended
to the original URL. Our backend servers will consume these serial numbers.
I did some googling, but failed to find any reference about what we
want
to achieve. I am guessing we may need to tweak the src code a little bit to
achieve
the goal.
So here are my questions:
1) is there any configuration change which can achieve our goal?
2) if 1) is not possible, what part of the code (which file/function)
I need to
look at to implement the hack? I guess there might be some global variables
that relate to this issue.
3) if we are doing 2), what level of performance overhead will be
expected?
Thanks so much,
--Zuoning