binskipy2u

sysctl.conf

Mar 15th, 2018
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.34 KB | None | 0 0
  1. vm.swappiness = 0
  2. vm.dirty_background_ratio = 50
  3. vm.dirty_ratio = 80
  4.  
  5.  
  6. # The maximum size of the receive queue.
  7. # The received frames will be stored in this queue after taking them from the ring buffer on the NIC.
  8. # Use high value for high speed cards to prevent loosing packets.
  9. # In real time application like SIP router, long queue must be assigned with high speed CPU otherwise the data in the queue will be out of date (old).
  10. net.core.netdev_max_backlog = 65536
  11. # The maximum ancillary buffer size allowed per socket.
  12. # Ancillary data is a sequence of struct cmsghdr structures with appended data.
  13. net.core.optmem_max = 65536
  14. # The upper limit on the value of the backlog parameter passed to the listen function.
  15. # Setting to higher values is only needed on a single highloaded server where new connection rate is high/bursty
  16. net.core.somaxconn = 16384
  17. # The default and maximum amount for the receive/send socket memory
  18. # By default the Linux network stack is not configured for high speed large file transfer across WAN links.
  19. # This is done to save memory resources.
  20. # You can easily tune Linux network stack by increasing network buffers size for high-speed networks that connect server systems to handle more network packets.
  21. net.core.rmem_default = 1048576
  22. net.core.wmem_default = 1048576
  23. net.core.rmem_max = 16777216
  24. net.core.wmem_max = 16777216
  25. net.ipv4.tcp_rmem = 4096 87380 16777216
  26. net.ipv4.tcp_wmem = 4096 65536 16777216
  27. net.ipv4.udp_rmem_min = 16384
  28. net.ipv4.udp_wmem_min = 16384
  29. # An extension to the transmission control protocol (TCP) that helps reduce network latency by enabling data to be exchanged during the sender’s initial TCP SYN.
  30. # If both of your server and client are deployed on Linux 3.7.1 or higher, you can turn on fast_open for lower latency
  31. net.ipv4.tcp_fastopen = 3
  32. # The maximum queue length of pending connections 'Waiting Acknowledgment'
  33. # In the event of a synflood DOS attack, this queue can fill up pretty quickly, at which point tcp_syncookies will kick in allowing your system to continue to respond to legitimate traffic, and allowing you to gain access to block malicious IPs.
  34. # If the server suffers from overloads at peak times, you may want to increase this value a little bit.
  35. net.ipv4.tcp_max_syn_backlog = 65536
  36. # The maximum number of sockets in 'TIME_WAIT' state.
  37. # After reaching this number the system will start destroying the socket in this state.
  38. # Increase this to prevent simple DOS attacks
  39. net.ipv4.tcp_max_tw_buckets = 65536
  40. # Whether TCP should start at the default window size only for new connections or also for existing connections that have been idle for too long.
  41. # It kills persistent single connection performance and should be turned off.
  42. net.ipv4.tcp_slow_start_after_idle = 0
  43. # Whether TCP should reuse an existing connection in the TIME-WAIT state for a new outgoing connection if the new timestamp is strictly bigger than the most recent timestamp recorded for the previous connection.
  44. # This helps avoid from running out of available network sockets.
  45. net.ipv4.tcp_tw_reuse = 1
  46. # Fast-fail FIN connections which are useless.
  47. net.ipv4.tcp_fin_timeout = 15
  48. # TCP keepalive is a mechanism for TCP connections that help to determine whether the other end has stopped responding or not.
  49. # TCP will send the keepalive probe contains null data to the network peer several times after a period of idle time. If the peer does not respond, the socket will be closed automatically.
  50. # By default, TCP keepalive process waits for two hours (7200 secs) for socket activity before sending the first keepalive probe, and then resend it every 75 seconds. As long as there is TCP/IP socket communications going on and active, no keepalive packets are needed.
  51. # With the following settings, your application will detect dead TCP connections after 120 seconds (60s + 10s + 10s + 10s + 10s + 10s + 10s)
  52. net.ipv4.tcp_keepalive_time = 60
  53. net.ipv4.tcp_keepalive_intvl = 10
  54. net.ipv4.tcp_keepalive_probes = 6
  55. # The longer the MTU the better for performance, but the worse for reliability.
  56. # This is because a lost packet means more data to be retransmitted and because many routers on the Internet can't deliver very long packets.
  57. # Enable smart MTU discovery when an ICMP black hole detected.
  58. net.ipv4.tcp_mtu_probing = 1
  59. # Turn timestamps off to reduce performance spikes related to timestamp generation.
  60. net.ipv4.tcp_timestamps = 0
Advertisement
Add Comment
Please, Sign In to add comment