On Sat, Apr 21, 2018 at 03:38:41PM +0200, Willy Tarreau wrote: > On Sat, Apr 21, 2018 at 03:35:02PM +0300, Slawa Olhovchenkov wrote: > > On Sat, Apr 21, 2018 at 01:49:37PM +0300, Slawa Olhovchenkov wrote: > > > > > On Fri, Apr 20, 2018 at 09:01:24PM +0200, Willy Tarreau wrote: > > > > So between these two the traffic is perfectly balanced. I don't see why > > > > you > > > > wouldn't have other threads :-/ > > > > > > > > Well, let's try something. In your global section you have a "stats > > > > socket ..." > > > > with a path. Please replicate this line to have 8 more of them, all > > > > with a > > > > different path (eg: /var/run/haproxy-stats becomes haproxy-stats1, > > > > -stats2 etc) > > > > and with a different thread binding using "process" like this : > > > > > > > > stats socket /var/run/haproxy-stats1 level admin process 1/1 > > > > stats socket /var/run/haproxy-stats2 level admin process 1/2 > > > > stats socket /var/run/haproxy-stats3 level admin process 1/3 > > > > ... > > > > stats socket /var/run/haproxy-stats8 level admin process 1/8 > > > > > > > > Then you can use the same command as above to dump exactly one thread's > > > > activity by connecting to each of these sockets. We definitely need to > > > > understand what the other threads are doing. > > > > > > Ok, I am need run haproxy some time for data collected. > > > > CPU 0 busy 0.157 > > CPU 1 busy 0.152 > > CPU 2 busy 0.310 > > CPU 3 busy 0.066 > > CPU 4 busy 1.000 > > CPU 5 busy 0.121 > > CPU 6 busy 0.192 > > CPU 7 busy 0.113 > (...) > > > thread_id: 0 > > loops: 66424562 83705569 78330851 71825493 4167226792 55628229 71817734 > > 60724445 > > stream: 10509732 11021411 25600986 2691749 42283170 7046275 14032863 6425591 > > OK, sorry I was confused, in fact each column above correspond to one distinct > thread. As you can see it's obvious that there are huge differences between > each one. > > So above we can see that thread 4 received many more requests than the other > ones. The number of loops is huge, just as if it did never sleep. Comparing > thread 2 to threads 0 and 1 shows that the CPU usage is more logical (ie: > twice the number of stream, twice the CPU load). > > Don't you have anything specificly bound to thread 4 in your config ? Or do > you know if your network interrupts would happen to be bound to CPU 4 and > possibly cause this important imbalance ?
No, all network interrupts bound to CPU 8-15. Also nothing specific for distinct CPU. After reload haproxy never sleep thread can be gone or start on different CPU. Random.

