PageRenderTime 57ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/aegir/conf/sysctl.conf

http://github.com/omega8cc/nginx-for-drupal
Config | 100 lines | 77 code | 23 blank | 0 comment | 0 complexity | 5424d342265938bd98875871403f5c17 MD5 | raw file
  1. # Avoid a smurf attack
  2. net.ipv4.icmp_echo_ignore_broadcasts = 1
  3. # Turn on protection for bad icmp error messages
  4. net.ipv4.icmp_ignore_bogus_error_responses = 1
  5. # Turn on syncookies for SYN flood attack protection
  6. # See also: http://cr.yp.to/syncookies.html
  7. net.ipv4.tcp_syncookies = 1
  8. # Don't log spoofed packets, source routed packets, redirect packets
  9. net.ipv4.conf.all.log_martians = 0
  10. net.ipv4.conf.default.log_martians = 0
  11. # Decrease the time default value for tcp_fin_timeout connection
  12. net.ipv4.tcp_fin_timeout = 15
  13. # Decrease the time default value for connections to keep alive
  14. net.ipv4.tcp_keepalive_time = 300
  15. net.ipv4.tcp_keepalive_probes = 5
  16. net.ipv4.tcp_keepalive_intvl = 15
  17. # Optimize this for SPDY performance
  18. net.ipv4.tcp_slow_start_after_idle = 0
  19. # No source routed packets here
  20. net.ipv4.conf.all.accept_source_route = 0
  21. net.ipv4.conf.default.accept_source_route = 0
  22. # Turn on reverse path filtering
  23. net.ipv4.conf.all.rp_filter = 1
  24. net.ipv4.conf.default.rp_filter = 1
  25. # Make sure no one can alter the routing tables
  26. net.ipv4.conf.all.accept_redirects = 0
  27. net.ipv4.conf.default.accept_redirects = 0
  28. net.ipv4.conf.all.secure_redirects = 0
  29. net.ipv4.conf.default.secure_redirects = 0
  30. net.ipv6.conf.all.accept_redirects = 0
  31. net.ipv6.conf.default.accept_redirects = 0
  32. # Don't act as a router
  33. net.ipv4.ip_forward = 0
  34. net.ipv4.conf.all.send_redirects = 0
  35. net.ipv4.conf.default.send_redirects = 0
  36. # Enable address space layout randomization (ASLR)
  37. kernel.randomize_va_space = 2
  38. # Tune IPv6
  39. net.ipv6.conf.default.router_solicitations = 0
  40. net.ipv6.conf.default.accept_ra_rtr_pref = 0
  41. net.ipv6.conf.default.accept_ra_pinfo = 0
  42. net.ipv6.conf.default.accept_ra_defrtr = 0
  43. net.ipv6.conf.default.autoconf = 0
  44. net.ipv6.conf.default.dad_transmits = 0
  45. net.ipv6.conf.default.max_addresses = 1
  46. # Optimization for port use for LBs
  47. # Increase system file descriptor limit
  48. fs.file-max = 2097152
  49. # Increase inotify defaults to improve lsyncd support
  50. fs.inotify.max_user_watches = 65536
  51. # Increase system IP port limits
  52. net.ipv4.ip_local_port_range = 2000 65000
  53. # Increase limits to avoid nf_conntrack: table full on high traffic events
  54. net.netfilter.nf_conntrack_max = 512000
  55. # Increase TCP max buffer size setable using setsockopt()
  56. net.ipv4.tcp_rmem = 4096 87380 8388608
  57. net.ipv4.tcp_wmem = 4096 87380 8388608
  58. # Improve Redis performance
  59. net.core.somaxconn = 512
  60. # Increase Linux auto tuning TCP buffer limits
  61. # min, default, and max number of bytes to use
  62. # set max to at least 4MB, or higher if you use very high BDP paths
  63. # Tcp Windows etc
  64. net.core.rmem_max = 8388608
  65. net.core.wmem_max = 8388608
  66. net.core.netdev_max_backlog = 65536
  67. net.ipv4.tcp_window_scaling = 1
  68. # Protect from CVE-2016-5696
  69. net.ipv4.tcp_challenge_ack_limit = 1073741823
  70. # Use swap only if there is high memory usage
  71. vm.swappiness = 1
  72. vm.vfs_cache_pressure=50
  73. # Specify the minimum virtual address that a process is allowed to mmap
  74. vm.mmap_min_addr = 4096
  75. # No overcommitment of available memory
  76. vm.overcommit_ratio = 0
  77. vm.overcommit_memory = 0