mirror of
https://github.com/OpenVPN/openvpn.git
synced 2024-09-20 03:52:28 +02:00
b0bff55901
If --mlock is used, the amount of memory OpenVPN can use is guarded by the RLIMIT_MEMLOCK value (see mlockall(2)). The OS default for this is usually 64 Kbyte, which is enough for OpenVPN to initialize, but as soon as the first TLS handshake comes it, OpenVPN will crash due to "ouf of memory", and might even end up in a crash loop. Steady-state OpenVPN requires between 8 MB and 30-50 MB (servers with many concurrent clients) of memory. TLS renegotiation with EC keys requires up to 90 MB of transient memory. So: with this patch, we check if getrlimit() is available, and if yes, log the amount of mlock'able memory. If the amount is below 100 MB, which is an arbitrary value "large enough for most smaller deployments", we try to increase the limits to 100 MB, and abort if this fails. v2: change arbitrary number to 100 MB, introduce #define for it not only check but also increase with setrlimit() uncrustify fixes v3: OpenSolaris has mlockall() and getrlimit(), but no RLIMIT_MEMLOCK - make code conditional on HAVE_GETRLIMIT *and* RLIMIT_MEMLOCK add Changes.rst entry Trac: #1390 Signed-off-by: Gert Doering <gert@greenie.muc.de> Acked-by: Selva Nair <selva.nair@gmail.com> Message-Id: <20210310124808.14741-1-gert@greenie.muc.de> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg21657.html Signed-off-by: Gert Doering <gert@greenie.muc.de> |
||
---|---|---|
.. | ||
advanced-options.rst | ||
cipher-negotiation.rst | ||
client-options.rst | ||
connection-profiles.rst | ||
encryption-options.rst | ||
examples.rst | ||
generic-options.rst | ||
inline-files.rst | ||
link-options.rst | ||
log-options.rst | ||
management-options.rst | ||
network-config.rst | ||
pkcs11-options.rst | ||
plugin-options.rst | ||
protocol-options.rst | ||
proxy-options.rst | ||
renegotiation.rst | ||
script-options.rst | ||
server-options.rst | ||
signals.rst | ||
tls-options.rst | ||
unsupported-options.rst | ||
virtual-routing-and-forwarding.rst | ||
vpn-network-options.rst | ||
windows-options.rst |