Guest User

Untitled

a guest
Jun 20th, 2018
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.84 KB | None | 0 0
  1. ### IMPROVE SYSTEM MEMORY MANAGEMENT ###
  2.  
  3. # Increase size of file handles and inode cache
  4. fs.file-max = 2097152
  5.  
  6. # Do less swapping
  7. vm.swappiness=10
  8. vm.vfs_cache_pressure = 50
  9. vm.dirty_ratio = 60
  10. vm.dirty_background_ratio = 2
  11.  
  12. ### GENERAL NETWORK SECURITY OPTIONS ###
  13.  
  14. # Number of times SYNACKs for passive TCP connection.
  15. net.ipv4.tcp_synack_retries = 2
  16.  
  17. # Allowed local port range
  18. net.ipv4.ip_local_port_range = 2000 65535
  19.  
  20. # Protect Against TCP Time-Wait
  21. net.ipv4.tcp_rfc1337 = 1
  22.  
  23. # Decrease the time default value for tcp_fin_timeout connection
  24. net.ipv4.tcp_fin_timeout = 15
  25.  
  26. # Decrease the time default value for connections to keep alive
  27. net.ipv4.tcp_keepalive_time = 300
  28. net.ipv4.tcp_keepalive_probes = 5
  29. net.ipv4.tcp_keepalive_intvl = 15
  30.  
  31. ### TUNING NETWORK PERFORMANCE ###
  32.  
  33. # Default Socket Receive Buffer
  34. net.core.rmem_default = 31457280
  35.  
  36. # Maximum Socket Receive Buffer
  37. net.core.rmem_max = 12582912
  38.  
  39. # Default Socket Send Buffer
  40. net.core.wmem_default = 31457280
  41.  
  42. # Maximum Socket Send Buffer
  43. net.core.wmem_max = 12582912
  44.  
  45. # Increase number of incoming connections
  46. net.core.somaxconn = 65535
  47.  
  48. # Increase number of incoming connections backlog
  49. net.core.netdev_max_backlog = 65535
  50.  
  51. # Increase the maximum amount of option memory buffers
  52. net.core.optmem_max = 25165824
  53.  
  54. # Increase the maximum total buffer-space allocatable
  55. # This is measured in units of pages (4096 bytes)
  56. net.ipv4.tcp_mem = 65535 131072 262144
  57. net.ipv4.udp_mem = 65535 131072 262144
  58.  
  59. # Increase the read-buffer space allocatable
  60. net.ipv4.tcp_rmem = 8192 87380 16777216
  61. net.ipv4.udp_rmem_min = 16384
  62.  
  63. # Increase the write-buffer-space allocatable
  64. net.ipv4.tcp_wmem = 8192 65535 16777216
  65. net.ipv4.udp_wmem_min = 16384
  66.  
  67. # Increase the tcp-time-wait buckets pool size to prevent simple DOS attacks
  68. net.ipv4.tcp_max_tw_buckets = 1440000
  69. net.ipv4.tcp_tw_recycle = 1
  70. net.ipv4.tcp_tw_reuse = 1
  71.  
  72. vm.overcommit_memory = 1
Add Comment
Please, Sign In to add comment