mirror of
https://github.com/haproxy/haproxy.git
synced 2026-03-01 21:01:26 -05:00
HAProxy - Load balancer
The lock in process_srv_queue() was placed around the whole loop to avoid the cost of taking/releasing it multiple times. But in practice almost all calls to this function only dequeue a single connection, so that argument doesn't really stand. However by placing the lock inside the loop, we'd make it possible to release it before manipulating the pendconn and waking the task up. That's what this patch does. This increases the performance from 431k to 491k req/s on 16 threads with 20 servers under leastconn. The performance profile changes from this: 14.09% haproxy [.] process_srv_queue 10.22% haproxy [.] fwlc_srv_reposition 6.39% haproxy [.] fwlc_get_next_server 3.97% haproxy [.] pendconn_dequeue 3.84% haproxy [.] pendconn_add to this: 13.03% haproxy [.] fwlc_srv_reposition 8.08% haproxy [.] fwlc_get_next_server 3.62% haproxy [.] process_srv_queue 1.78% haproxy [.] pendconn_dequeue 1.74% haproxy [.] pendconn_add The difference is even slightly more visible in roundrobin which does not have take_conn() call. |
||
|---|---|---|
| .github | ||
| addons | ||
| admin | ||
| dev | ||
| doc | ||
| examples | ||
| include | ||
| reg-tests | ||
| scripts | ||
| src | ||
| tests | ||
| .cirrus.yml | ||
| .gitattributes | ||
| .gitignore | ||
| .travis.yml | ||
| BRANCHES | ||
| CHANGELOG | ||
| CONTRIBUTING | ||
| INSTALL | ||
| LICENSE | ||
| MAINTAINERS | ||
| Makefile | ||
| README | ||
| ROADMAP | ||
| SUBVERS | ||
| VERDATE | ||
| VERSION | ||
The HAProxy documentation has been split into a number of different files for ease of use. Please refer to the following files depending on what you're looking for : - INSTALL for instructions on how to build and install HAProxy - BRANCHES to understand the project's life cycle and what version to use - LICENSE for the project's license - CONTRIBUTING for the process to follow to submit contributions The more detailed documentation is located into the doc/ directory : - doc/intro.txt for a quick introduction on HAProxy - doc/configuration.txt for the configuration's reference manual - doc/lua.txt for the Lua's reference manual - doc/SPOE.txt for how to use the SPOE engine - doc/network-namespaces.txt for how to use network namespaces under Linux - doc/management.txt for the management guide - doc/regression-testing.txt for how to use the regression testing suite - doc/peers.txt for the peers protocol reference - doc/coding-style.txt for how to adopt HAProxy's coding style - doc/internals for developer-specific documentation (not all up to date)