mirror of
https://github.com/haproxy/haproxy.git
synced 2026-04-27 09:06:46 -04:00
HAProxy - Load balancer
When a maximum memory setting is passed to haproxy and maxconn is not set and ulimit-n is not set, it is expected that maxconn will be set to the highest value permitted by this memory setting, possibly affecting the FD limit. When maxconn was changed to be deduced from the current process's FD limit, the automatic setting above was partially lost because it now remains limited to the current FD limit in addition to being limited to the memory usage. For unprivileged processes it does not change anything, but for privileged processes the difference is important. Indeed, the previous behavior ensured that the new FD limit could be enforced on the process as long as the user had the privilege to do so. Now this does not happen anymore, and some people rely on this for automatic sizing in VM environments. This patch implements the ability to verify if the setting will be enforceable on the process or not. First it computes maxconn based on the memory limits alone, then checks if the process is willing to accept them, otherwise tries again by respecting the process' hard limit. Thanks to this we now have the best of the pre-2.0 behavior and the current one, in that privileged users will be able to get as high a maxconn as they need just based on the memory limit, while unprivileged users will still get as high a setting as permitted by the intersection of the memory limit and the process' FD limit. Ideally, after some observation period, this patch along with the previous one "MINOR: init: move the maxsock calculation code to compute_ideal_maxsock()" should be backported to 2.1 and 2.0. Thanks to Baptiste for raising the issue. |
||
|---|---|---|
| .github | ||
| contrib | ||
| doc | ||
| ebtree | ||
| examples | ||
| include | ||
| reg-tests | ||
| scripts | ||
| src | ||
| tests | ||
| .cirrus.yml | ||
| .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)