ipvs-sysctl.txt 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  1. /proc/sys/net/ipv4/vs/* Variables:
  2. am_droprate - INTEGER
  3. default 10
  4. It sets the always mode drop rate, which is used in the mode 3
  5. of the drop_rate defense.
  6. amemthresh - INTEGER
  7. default 1024
  8. It sets the available memory threshold (in pages), which is
  9. used in the automatic modes of defense. When there is no
  10. enough available memory, the respective strategy will be
  11. enabled and the variable is automatically set to 2, otherwise
  12. the strategy is disabled and the variable is set to 1.
  13. backup_only - BOOLEAN
  14. 0 - disabled (default)
  15. not 0 - enabled
  16. If set, disable the director function while the server is
  17. in backup mode to avoid packet loops for DR/TUN methods.
  18. conn_reuse_mode - INTEGER
  19. 1 - default
  20. Controls how ipvs will deal with connections that are detected
  21. port reuse. It is a bitmap, with the values being:
  22. 0: disable any special handling on port reuse. The new
  23. connection will be delivered to the same real server that was
  24. servicing the previous connection. This will effectively
  25. disable expire_nodest_conn.
  26. bit 1: enable rescheduling of new connections when it is safe.
  27. That is, whenever expire_nodest_conn and for TCP sockets, when
  28. the connection is in TIME_WAIT state (which is only possible if
  29. you use NAT mode).
  30. bit 2: it is bit 1 plus, for TCP connections, when connections
  31. are in FIN_WAIT state, as this is the last state seen by load
  32. balancer in Direct Routing mode. This bit helps on adding new
  33. real servers to a very busy cluster.
  34. conntrack - BOOLEAN
  35. 0 - disabled (default)
  36. not 0 - enabled
  37. If set, maintain connection tracking entries for
  38. connections handled by IPVS.
  39. This should be enabled if connections handled by IPVS are to be
  40. also handled by stateful firewall rules. That is, iptables rules
  41. that make use of connection tracking. It is a performance
  42. optimisation to disable this setting otherwise.
  43. Connections handled by the IPVS FTP application module
  44. will have connection tracking entries regardless of this setting.
  45. Only available when IPVS is compiled with CONFIG_IP_VS_NFCT enabled.
  46. cache_bypass - BOOLEAN
  47. 0 - disabled (default)
  48. not 0 - enabled
  49. If it is enabled, forward packets to the original destination
  50. directly when no cache server is available and destination
  51. address is not local (iph->daddr is RTN_UNICAST). It is mostly
  52. used in transparent web cache cluster.
  53. debug_level - INTEGER
  54. 0 - transmission error messages (default)
  55. 1 - non-fatal error messages
  56. 2 - configuration
  57. 3 - destination trash
  58. 4 - drop entry
  59. 5 - service lookup
  60. 6 - scheduling
  61. 7 - connection new/expire, lookup and synchronization
  62. 8 - state transition
  63. 9 - binding destination, template checks and applications
  64. 10 - IPVS packet transmission
  65. 11 - IPVS packet handling (ip_vs_in/ip_vs_out)
  66. 12 or more - packet traversal
  67. Only available when IPVS is compiled with CONFIG_IP_VS_DEBUG enabled.
  68. Higher debugging levels include the messages for lower debugging
  69. levels, so setting debug level 2, includes level 0, 1 and 2
  70. messages. Thus, logging becomes more and more verbose the higher
  71. the level.
  72. drop_entry - INTEGER
  73. 0 - disabled (default)
  74. The drop_entry defense is to randomly drop entries in the
  75. connection hash table, just in order to collect back some
  76. memory for new connections. In the current code, the
  77. drop_entry procedure can be activated every second, then it
  78. randomly scans 1/32 of the whole and drops entries that are in
  79. the SYN-RECV/SYNACK state, which should be effective against
  80. syn-flooding attack.
  81. The valid values of drop_entry are from 0 to 3, where 0 means
  82. that this strategy is always disabled, 1 and 2 mean automatic
  83. modes (when there is no enough available memory, the strategy
  84. is enabled and the variable is automatically set to 2,
  85. otherwise the strategy is disabled and the variable is set to
  86. 1), and 3 means that that the strategy is always enabled.
  87. drop_packet - INTEGER
  88. 0 - disabled (default)
  89. The drop_packet defense is designed to drop 1/rate packets
  90. before forwarding them to real servers. If the rate is 1, then
  91. drop all the incoming packets.
  92. The value definition is the same as that of the drop_entry. In
  93. the automatic mode, the rate is determined by the follow
  94. formula: rate = amemthresh / (amemthresh - available_memory)
  95. when available memory is less than the available memory
  96. threshold. When the mode 3 is set, the always mode drop rate
  97. is controlled by the /proc/sys/net/ipv4/vs/am_droprate.
  98. expire_nodest_conn - BOOLEAN
  99. 0 - disabled (default)
  100. not 0 - enabled
  101. The default value is 0, the load balancer will silently drop
  102. packets when its destination server is not available. It may
  103. be useful, when user-space monitoring program deletes the
  104. destination server (because of server overload or wrong
  105. detection) and add back the server later, and the connections
  106. to the server can continue.
  107. If this feature is enabled, the load balancer will expire the
  108. connection immediately when a packet arrives and its
  109. destination server is not available, then the client program
  110. will be notified that the connection is closed. This is
  111. equivalent to the feature some people requires to flush
  112. connections when its destination is not available.
  113. expire_quiescent_template - BOOLEAN
  114. 0 - disabled (default)
  115. not 0 - enabled
  116. When set to a non-zero value, the load balancer will expire
  117. persistent templates when the destination server is quiescent.
  118. This may be useful, when a user makes a destination server
  119. quiescent by setting its weight to 0 and it is desired that
  120. subsequent otherwise persistent connections are sent to a
  121. different destination server. By default new persistent
  122. connections are allowed to quiescent destination servers.
  123. If this feature is enabled, the load balancer will expire the
  124. persistence template if it is to be used to schedule a new
  125. connection and the destination server is quiescent.
  126. ignore_tunneled - BOOLEAN
  127. 0 - disabled (default)
  128. not 0 - enabled
  129. If set, ipvs will set the ipvs_property on all packets which are of
  130. unrecognized protocols. This prevents us from routing tunneled
  131. protocols like ipip, which is useful to prevent rescheduling
  132. packets that have been tunneled to the ipvs host (i.e. to prevent
  133. ipvs routing loops when ipvs is also acting as a real server).
  134. nat_icmp_send - BOOLEAN
  135. 0 - disabled (default)
  136. not 0 - enabled
  137. It controls sending icmp error messages (ICMP_DEST_UNREACH)
  138. for VS/NAT when the load balancer receives packets from real
  139. servers but the connection entries don't exist.
  140. pmtu_disc - BOOLEAN
  141. 0 - disabled
  142. not 0 - enabled (default)
  143. By default, reject with FRAG_NEEDED all DF packets that exceed
  144. the PMTU, irrespective of the forwarding method. For TUN method
  145. the flag can be disabled to fragment such packets.
  146. secure_tcp - INTEGER
  147. 0 - disabled (default)
  148. The secure_tcp defense is to use a more complicated TCP state
  149. transition table. For VS/NAT, it also delays entering the
  150. TCP ESTABLISHED state until the three way handshake is completed.
  151. The value definition is the same as that of drop_entry and
  152. drop_packet.
  153. sync_threshold - vector of 2 INTEGERs: sync_threshold, sync_period
  154. default 3 50
  155. It sets synchronization threshold, which is the minimum number
  156. of incoming packets that a connection needs to receive before
  157. the connection will be synchronized. A connection will be
  158. synchronized, every time the number of its incoming packets
  159. modulus sync_period equals the threshold. The range of the
  160. threshold is from 0 to sync_period.
  161. When sync_period and sync_refresh_period are 0, send sync only
  162. for state changes or only once when pkts matches sync_threshold
  163. sync_refresh_period - UNSIGNED INTEGER
  164. default 0
  165. In seconds, difference in reported connection timer that triggers
  166. new sync message. It can be used to avoid sync messages for the
  167. specified period (or half of the connection timeout if it is lower)
  168. if connection state is not changed since last sync.
  169. This is useful for normal connections with high traffic to reduce
  170. sync rate. Additionally, retry sync_retries times with period of
  171. sync_refresh_period/8.
  172. sync_retries - INTEGER
  173. default 0
  174. Defines sync retries with period of sync_refresh_period/8. Useful
  175. to protect against loss of sync messages. The range of the
  176. sync_retries is from 0 to 3.
  177. sync_qlen_max - UNSIGNED LONG
  178. Hard limit for queued sync messages that are not sent yet. It
  179. defaults to 1/32 of the memory pages but actually represents
  180. number of messages. It will protect us from allocating large
  181. parts of memory when the sending rate is lower than the queuing
  182. rate.
  183. sync_sock_size - INTEGER
  184. default 0
  185. Configuration of SNDBUF (master) or RCVBUF (slave) socket limit.
  186. Default value is 0 (preserve system defaults).
  187. sync_ports - INTEGER
  188. default 1
  189. The number of threads that master and backup servers can use for
  190. sync traffic. Every thread will use single UDP port, thread 0 will
  191. use the default port 8848 while last thread will use port
  192. 8848+sync_ports-1.
  193. snat_reroute - BOOLEAN
  194. 0 - disabled
  195. not 0 - enabled (default)
  196. If enabled, recalculate the route of SNATed packets from
  197. realservers so that they are routed as if they originate from the
  198. director. Otherwise they are routed as if they are forwarded by the
  199. director.
  200. If policy routing is in effect then it is possible that the route
  201. of a packet originating from a director is routed differently to a
  202. packet being forwarded by the director.
  203. If policy routing is not in effect then the recalculated route will
  204. always be the same as the original route so it is an optimisation
  205. to disable snat_reroute and avoid the recalculation.
  206. sync_persist_mode - INTEGER
  207. default 0
  208. Controls the synchronisation of connections when using persistence
  209. 0: All types of connections are synchronised
  210. 1: Attempt to reduce the synchronisation traffic depending on
  211. the connection type. For persistent services avoid synchronisation
  212. for normal connections, do it only for persistence templates.
  213. In such case, for TCP and SCTP it may need enabling sloppy_tcp and
  214. sloppy_sctp flags on backup servers. For non-persistent services
  215. such optimization is not applied, mode 0 is assumed.
  216. sync_version - INTEGER
  217. default 1
  218. The version of the synchronisation protocol used when sending
  219. synchronisation messages.
  220. 0 selects the original synchronisation protocol (version 0). This
  221. should be used when sending synchronisation messages to a legacy
  222. system that only understands the original synchronisation protocol.
  223. 1 selects the current synchronisation protocol (version 1). This
  224. should be used where possible.
  225. Kernels with this sync_version entry are able to receive messages
  226. of both version 1 and version 2 of the synchronisation protocol.