ipvs-sysctl.txt 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  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. secure_tcp - INTEGER
  141. 0 - disabled (default)
  142. The secure_tcp defense is to use a more complicated TCP state
  143. transition table. For VS/NAT, it also delays entering the
  144. TCP ESTABLISHED state until the three way handshake is completed.
  145. The value definition is the same as that of drop_entry and
  146. drop_packet.
  147. sync_threshold - INTEGER
  148. default 3
  149. It sets synchronization threshold, which is the minimum number
  150. of incoming packets that a connection needs to receive before
  151. the connection will be synchronized. A connection will be
  152. synchronized, every time the number of its incoming packets
  153. modulus 50 equals the threshold. The range of the threshold is
  154. from 0 to 49.
  155. snat_reroute - BOOLEAN
  156. 0 - disabled
  157. not 0 - enabled (default)
  158. If enabled, recalculate the route of SNATed packets from
  159. realservers so that they are routed as if they originate from the
  160. director. Otherwise they are routed as if they are forwarded by the
  161. director.
  162. If policy routing is in effect then it is possible that the route
  163. of a packet originating from a director is routed differently to a
  164. packet being forwarded by the director.
  165. If policy routing is not in effect then the recalculated route will
  166. always be the same as the original route so it is an optimisation
  167. to disable snat_reroute and avoid the recalculation.
  168. sync_persist_mode - INTEGER
  169. default 0
  170. Controls the synchronisation of connections when using persistence
  171. 0: All types of connections are synchronised
  172. 1: Attempt to reduce the synchronisation traffic depending on
  173. the connection type. For persistent services avoid synchronisation
  174. for normal connections, do it only for persistence templates.
  175. In such case, for TCP and SCTP it may need enabling sloppy_tcp and
  176. sloppy_sctp flags on backup servers. For non-persistent services
  177. such optimization is not applied, mode 0 is assumed.
  178. sync_version - INTEGER
  179. default 1
  180. The version of the synchronisation protocol used when sending
  181. synchronisation messages.
  182. 0 selects the original synchronisation protocol (version 0). This
  183. should be used when sending synchronisation messages to a legacy
  184. system that only understands the original synchronisation protocol.
  185. 1 selects the current synchronisation protocol (version 1). This
  186. should be used where possible.
  187. Kernels with this sync_version entry are able to receive messages
  188. of both version 1 and version 2 of the synchronisation protocol.