Difference between revisions of "Tuning the Server"

From SponsorBlock
Jump to navigation Jump to search
(Raise ulimit)
(more limits)
Line 1: Line 1:
==== Increase ulimit ====
==== Increase ulimit ====
  ulimit -n 65535
  ulimit -n 65535
==== Sysctl ====


==== Increase the ports available ====
==== Increase the ports available ====
Line 11: Line 13:
And add this line to <code>/etc/sysctl.conf</code>
And add this line to <code>/etc/sysctl.conf</code>
  net.core.somaxconn=324000
  net.core.somaxconn=324000
===== More limits =====
net.ipv4.tcp_max_syn_backlog=3240000
net.core.netdev_max_backlog=10000
==== Security limits ====
Add these lines to <code>/etc/security/limits.conf</code>
*              soft    nofile          65535
*              hard    nofile          65535

Revision as of 17:25, 5 December 2021

Increase ulimit

ulimit -n 65535

Sysctl

Increase the ports available

sysctl -w net.ipv4.ip_local_port_range="9000 65500"

And add this line to /etc/sysctl.conf

net.ipv4.ip_local_port_range=9000 65500

Increase max connections

sysctl -w net.core.somaxconn=324000

And add this line to /etc/sysctl.conf

net.core.somaxconn=324000
More limits
net.ipv4.tcp_max_syn_backlog=3240000
net.core.netdev_max_backlog=10000

Security limits

Add these lines to /etc/security/limits.conf

*               soft    nofile          65535
*               hard    nofile          65535