On Thu, Apr 14, 2016 at 08:55:47AM +0200, Lukas Tribus wrote: > Hi Willy, > > > Am 14.04.2016 um 07:08 schrieb Willy Tarreau: > >Hi Lukas, > > > >On Thu, Apr 14, 2016 at 12:14:15AM +0200, Lukas Tribus wrote: > >>For example, the following configuration load balances the traffic across > >>all 40 processes, expected or not? > >> > >>frontend haproxy_test > >> bind-process 1-40 > >> bind :12345 process 1 > > > >It's not expected. What is indicated above is that the frontend will > >exist for the first 40 processes, and that port 12345 will be bound > >only in process 1. Processes 2..40 will thus have no listener at all. > > Well, we do only bind once here, not 40 times. But the traffic is then > handled by all 40 processes.
No here it's handled by only one due to "bind :12345 process 1". If there was not this "process 1", then it would indeed be handled by all 40 processes in a random fashion. > Le me put it this way: > > frontend haproxy_test > bind-process 1-8 > bind :12345 process 1 > bind :12345 process 2 > bind :12345 process 3 > bind :12345 process 4 > > > Leads to 8 processes, and the master process binds the socket 4 times (PID > 16509): > > lukas@ubuntuvm:~/haproxy-1.5$ ps auxww | grep haproxy > haproxy 16509 0.0 0.0 18460 320 ? Ss 08:41 0:00 ./haproxy > -f ../cert/ruppert-nbproc-stress.cfg -D > haproxy 16510 0.0 0.0 18460 320 ? Ss 08:41 0:00 ./haproxy > -f ../cert/ruppert-nbproc-stress.cfg -D > haproxy 16511 0.0 0.0 18460 320 ? Ss 08:41 0:00 ./haproxy > -f ../cert/ruppert-nbproc-stress.cfg -D > haproxy 16512 0.0 0.0 18460 320 ? Ss 08:41 0:00 ./haproxy > -f ../cert/ruppert-nbproc-stress.cfg -D > haproxy 16513 0.0 0.0 18460 320 ? Ss 08:41 0:00 ./haproxy > -f ../cert/ruppert-nbproc-stress.cfg -D > haproxy 16514 0.0 0.0 18460 320 ? Ss 08:41 0:00 ./haproxy > -f ../cert/ruppert-nbproc-stress.cfg -D > haproxy 16515 0.0 0.0 18460 320 ? Ss 08:41 0:00 ./haproxy > -f ../cert/ruppert-nbproc-stress.cfg -D > haproxy 16516 0.0 0.0 18460 320 ? Ss 08:41 0:00 ./haproxy > -f ../cert/ruppert-nbproc-stress.cfg -D > lukas@ubuntuvm:~/haproxy-1.5$ sudo netstat -tlp | grep hap > tcp 0 0 *:12345 *:* LISTEN 16509/haproxy > tcp 0 0 *:12345 *:* LISTEN 16509/haproxy > tcp 0 0 *:12345 *:* LISTEN 16509/haproxy > tcp 0 0 *:12345 *:* LISTEN 16509/haproxy > lukas@ubuntuvm:~/haproxy-1.5$ Then this is where we have a problem. Only processes 1..4 should be bound. > >But I'm rather surprized, maybe we recently broke something because > >we have a lot of people successfully running such configurations, > >which is why I'm a bit surprized. > > I can reproduce this in v1.5.0 too, I think it was always like that. I'm still very surprized because what this means is that each time we managed to make a config work with such a setup it was by pure luck. The most common use-case is with SSL and I'm aware of a significant number of deployments running this way with the expected results. I'll have to run some local tests to understand what's going on. Thanks, Willy