mirror of
https://github.com/haproxy/haproxy.git
synced 2026-04-12 12:26:15 -04:00
Proxies and servers both have a queueslength entry, that indicates how many entries there are in their request queues. Those can get a lot of contention, and they are often accessed just to know if the queue is empty or not, which it will always be when there is no maxconn. So for both, introduce a new field, "queues_not_empty", in a different, less contended cache line, and use it every time we just want to know if the queue is empty or not. Those are only changed when the queues goes from empty to non-empty, and vice-versa, which hopefully should not be too often. For proxies, they are protected by the proxy lock. For servers, they are protected by a new lock contained in the server, the status_lock. In both case, to prevent any race condition, once the relevant lock is held, the value of queueslength should be checked again before deciding to change or not queues_not_empty, to prevent any race condition. |
||
|---|---|---|
| .. | ||
| haproxy | ||
| import | ||
| make | ||