Skip to content

Commit

Permalink
doc/tutorials/tcp_tunning: note about network buffers size
Browse files Browse the repository at this point in the history
- they may need tunning when dealing with large data

(cherry picked from commit 38a696f)
(cherry picked from commit d44cf21)
(cherry picked from commit bd6dffa)
  • Loading branch information
miconda committed Apr 3, 2019
1 parent 5d1d4a8 commit dbc2090
Showing 1 changed file with 25 additions and 9 deletions.
34 changes: 25 additions & 9 deletions doc/tutorials/tcp_tunning.txt
Expand Up @@ -19,22 +19,22 @@ For now it deals only with Linux specific optimizations.

net.core.somaxconn - limit of the listen() backlog, default 128
net.ipv4.tcp_max_syn_backlog - default 1024 or 128
net.ipv4.tcp_timestamps - default on., should be on (along with
net.ipv4.tcp_timestamps - default on., should be on (along with
tcp_tw_recycle and timestamp supporting
peers allows for fast connections rates)

1.2 connection in close_wait
1.2 Connection in close_wait

Connection should stay as little as possible
in close_wait to quickly free the fd/resources for new connections attempts
WARNING: this could break normal TCP use, use it only if you know what you are
Connection should stay as little as possible
in close_wait to quickly free the fd/resources for new connections attempts
WARNING: this could break normal TCP use, use it only if you know what you are
doing

net.ipv4.tcp_max_tw_buckets - maximum number of timewait sockets
(the default seems to be ok)
net.ipv4.tcp_tw_recycle - enables fast time wait sockets recycling (default
off), should be enabled if you have lots of short
lived connections
lived connections
WARNING: see the above warning
net.ipv4.tcp_tw_reuse - allows reusing of time-wait sockets (default off)
WARNING: see above
Expand All @@ -49,10 +49,26 @@ net.ipv4.ip_local_port_range - should be increased (e.g. 4096-65534)
1.4 Open file descriptors

fs.file-max - maximum number of fds that will be allocated
(you probably need to increase it, default
(you probably need to increase it, default
depends on installed memory)

1.5 other sysctl that might affect tcp connection rate or the maximum number
1.5 Buffers size

When dealing with large data, check the values for network sockets buffers
to be sufficient, among them:

net.core.rmem_max
net.core.wmem_max
net.core.rmem_default
net.core.wmem_default
net.ipv4.tcp_mem
net.ipv4.tcp_rmem
net.ipv4.tcp_wmem

Note: sysctl -w net.ipv4.route.flush=1 - enusre that immediatly subsequent
connections use the values

1.6 Other sysctl that might affect tcp connection rate or the maximum number
of open connections

fs.epoll.max_user_instances - maximum number of devices - per user (2.6.27.8+)
Expand Down

0 comments on commit dbc2090

Please sign in to comment.