Hi,

On 05/31/2016 11:55 AM, Unknown User wrote:
> I am running haproxy with nbproc 3. (I know its not supported, but i
> want to use more than 1 cpu with haproxy)

Don't worry, it still works really well :)

> The following is my config related to the stats socket
> 
>     daemon
>     nbproc 3
>     pidfile /var/run/hapxy.pid
>                 # Does not work with nbproc  >1
>     stats socket  /var/run/hapxy.sock  level admin
>     # echo 'show stat' | nc -U /var/run/hapxy.sock
>     # Logging

Note that the processes don't (really) know anything about each other. As
such, when talking to one admin socket, you are reaching exactly one
process. Which one depends on your config and some other stuff.

> When setting weight, it seems only one of the haproxy process get the
> updated weight. See below. The weight is increased to 20 from a
> default 10 for all processes, but subsequent show stat's may show
> either 10 or 20.
> Is there any way to make the weight change applicable for all processes?

Yes. Make sure each process has it's own stats socket, e.g.:

  nbproc 3

  # expose admin socket for each process
  stats socket /var/run/hapxy.1.sock level admin process 1
  stats socket /var/run/hapxy.2.sock level admin process 2
  stats socket /var/run/hapxy.3.sock level admin process 3

Now, the only thing that's slightly unfortunate, you have to send the
corresponding command to each admin socket. But if you do so, everything
will work as expected.

Hope that helps,
Conrad


> [[email protected]  run]# echo show stat | nc -U hapxy.sock  |
> grep host02.unknownservers.net
> pxy_noxff,host02.unknownservers.net,0,0,0,1,,1,984,221,,0,,0,0,0,0,UP,10,1,0,0,0,7,0,,2,7,25,,1,,2,0,,1,L7OK,200,0,0,0,1,0,0,0,0,,,,0,0,
> pxy_xff,host02.unknownservers.net,0,0,0,0,,0,0,0,,0,,0,0,0,0,UP,1,1,0,,,,,,2,8,25,,0,pxy_noxff/host02.unknownservers.net,2,0,,0,,,,0,0,0,0,0,0,0,,,,0,0,
> [[email protected]  run]# echo set weight
> pxy_noxff/host02.unknownservers.net 20 | nc -U hapxy.sock
> 
> [[email protected]  run]# echo show stat | nc -U hapxy.sock  |
> grep host02.unknownservers.net
> pxy_noxff,host02.unknownservers.net,0,0,0,1,,3,4574,3367,,0,,0,0,0,0,UP,20,1,0,0,0,18,0,,3,7,25,,3,,2,0,,1,L7OK,200,0,0,1,2,0,0,0,0,,,,0,0,
> pxy_xff,host02.unknownservers.net,0,0,0,0,,0,0,0,,0,,0,0,0,0,UP,1,1,0,,,,,,3,8,25,,0,pxy_noxff/host02.unknownservers.net,2,0,,0,,,,0,0,0,0,0,0,0,,,,0,0,
> [[email protected]  run]# echo show stat | nc -U hapxy.sock  |
> grep host02.unknownservers.net
> pxy_noxff,host02.unknownservers.net,0,0,0,1,,4,5709,4877,,0,,0,0,0,0,UP,20,1,0,0,0,20,0,,3,7,25,,4,,2,1,,1,L7OK,200,0,0,2,2,0,0,0,0,,,,0,0,
> pxy_xff,host02.unknownservers.net,0,0,0,0,,0,0,0,,0,,0,0,0,0,UP,1,1,0,,,,,,3,8,25,,0,pxy_noxff/host02.unknownservers.net,2,0,,0,,,,0,0,0,0,0,0,0,,,,0,0,
> [[email protected]  run]# echo show stat | nc -U hapxy.sock  |
> grep host02.unknownservers.net
> pxy_noxff,host02.unknownservers.net,0,0,1,1,,5,5709,4877,,0,,0,0,0,0,UP,20,1,0,0,0,24,0,,3,7,25,,5,,2,1,,1,L7OK,200,0,0,2,2,0,0,0,0,,,,0,0,
> pxy_xff,host02.unknownservers.net,0,0,0,0,,0,0,0,,0,,0,0,0,0,UP,1,1,0,,,,,,3,8,25,,0,pxy_noxff/host02.unknownservers.net,2,0,,0,,,,0,0,0,0,0,0,0,,,,0,0,
> [[email protected]  run]# echo show stat | nc -U hapxy.sock  |
> grep host02.unknownservers.net
> pxy_noxff,host02.unknownservers.net,0,0,0,1,,2,3118,510,,0,,0,0,0,0,UP,10,1,0,0,0,27,0,,2,7,25,,2,,2,0,,1,L7OK,200,0,0,1,1,0,0,0,0,,,,0,0,
> pxy_xff,host02.unknownservers.net,0,0,0,0,,0,0,0,,0,,0,0,0,0,UP,1,1,0,,,,,,2,8,25,,0,pxy_noxff/host02.unknownservers.net,2,0,,0,,,,0,0,0,0,0,0,0,,,,0,0,
> [[email protected]  run]# echo show stat | nc -U hapxy.sock  |
> grep host02.unknownservers.net
> pxy_noxff,host02.unknownservers.net,0,0,0,1,,2,3118,510,,0,,0,0,0,0,UP,10,1,0,0,0,30,0,,2,7,25,,2,,2,0,,1,L7OK,200,0,0,1,1,0,0,0,0,,,,0,0,
> pxy_xff,host02.unknownservers.net,0,0,0,0,,0,0,0,,0,,0,0,0,0,UP,1,1,0,,,,,,2,8,25,,0,pxy_noxff/host02.unknownservers.net,2,0,,0,,,,0,0,0,0,0,0,0,,,,0,0,
> [[email protected]  run]# echo show stat | nc -U hapxy.sock  |
> grep host02.unknownservers.net
> pxy_noxff,host02.unknownservers.net,0,0,0,1,,9,13922,7429,,0,,0,0,0,0,UP,20,1,0,0,0,36,0,,3,7,25,,9,,2,1,,1,L7OK,200,0,0,4,5,0,0,0,0,,,,0,0,
> pxy_xff,host02.unknownservers.net,0,0,0,0,,0,0,0,,0,,0,0,0,0,UP,1,1,0,,,,,,3,8,25,,0,pxy_noxff/host02.unknownservers.net,2,0,,0,,,,0,0,0,0,0,0,0,,,,0,0,
> [[email protected]  run]# echo show stat | nc -U hapxy.sock  |
> grep host02.unknownservers.net
> pxy_noxff,host02.unknownservers.net,0,0,0,1,,3,5232,799,,0,,0,0,0,0,UP,10,1,0,0,0,41,0,,2,7,25,,3,,2,1,,1,L7OK,200,0,0,2,1,0,0,0,0,,,,0,0,
> pxy_xff,host02.unknownservers.net,0,0,0,0,,0,0,0,,0,,0,0,0,0,UP,1,1,0,,,,,,2,8,25,,0,pxy_noxff/host02.unknownservers.net,2,0,,0,,,,0,0,0,0,0,0,0,,,,0,0,
> [[email protected]  run]# echo show stat | nc -U hapxy.sock  |
> grep host02.unknownservers.net
> pxy_noxff,host02.unknownservers.net,0,0,0,1,,11,17448,7938,,0,,0,0,0,0,UP,20,1,0,0,0,43,0,,3,7,25,,11,,2,0,,1,L7OK,200,0,0,5,6,0,0,0,0,,,,0,0,
> pxy_xff,host02.unknownservers.net,0,0,0,0,,0,0,0,,0,,0,0,0,0,UP,1,1,0,,,,,,3,8,25,,0,pxy_noxff/host02.unknownservers.net,2,0,,0,,,,0,0,0,0,0,0,0,,,,0,0,
> 

-- 
Conrad Hoffmann
Traffic Engineer

SoundCloud Ltd. | Rheinsberger Str. 76/77, 10115 Berlin, Germany

Managing Director: Alexander Ljung | Incorporated in England & Wales
with Company No. 6343600 | Local Branch Office | AG Charlottenburg |
HRB 110657B

Reply via email to