0001 # SPDX-License-Identifier: GPL-2.0-only
0002 #
0003 # IP Virtual Server configuration
0004 #
0005 menuconfig IP_VS
0006 tristate "IP virtual server support"
0007 depends on INET && NETFILTER
0008 depends on (NF_CONNTRACK || NF_CONNTRACK=n)
0009 help
0010 IP Virtual Server support will let you build a high-performance
0011 virtual server based on cluster of two or more real servers. This
0012 option must be enabled for at least one of the clustered computers
0013 that will take care of intercepting incoming connections to a
0014 single IP address and scheduling them to real servers.
0015
0016 Three request dispatching techniques are implemented, they are
0017 virtual server via NAT, virtual server via tunneling and virtual
0018 server via direct routing. The several scheduling algorithms can
0019 be used to choose which server the connection is directed to,
0020 thus load balancing can be achieved among the servers. For more
0021 information and its administration program, please visit the
0022 following URL: <http://www.linuxvirtualserver.org/>.
0023
0024 If you want to compile it in kernel, say Y. To compile it as a
0025 module, choose M here. If unsure, say N.
0026
0027 if IP_VS
0028
0029 config IP_VS_IPV6
0030 bool "IPv6 support for IPVS"
0031 depends on IPV6 = y || IP_VS = IPV6
0032 select NF_DEFRAG_IPV6
0033 help
0034 Add IPv6 support to IPVS.
0035
0036 Say Y if unsure.
0037
0038 config IP_VS_DEBUG
0039 bool "IP virtual server debugging"
0040 help
0041 Say Y here if you want to get additional messages useful in
0042 debugging the IP virtual server code. You can change the debug
0043 level in /proc/sys/net/ipv4/vs/debug_level
0044
0045 config IP_VS_TAB_BITS
0046 int "IPVS connection table size (the Nth power of 2)"
0047 range 8 20
0048 default 12
0049 help
0050 The IPVS connection hash table uses the chaining scheme to handle
0051 hash collisions. Using a big IPVS connection hash table will greatly
0052 reduce conflicts when there are hundreds of thousands of connections
0053 in the hash table.
0054
0055 Note the table size must be power of 2. The table size will be the
0056 value of 2 to the your input number power. The number to choose is
0057 from 8 to 20, the default number is 12, which means the table size
0058 is 4096. Don't input the number too small, otherwise you will lose
0059 performance on it. You can adapt the table size yourself, according
0060 to your virtual server application. It is good to set the table size
0061 not far less than the number of connections per second multiplying
0062 average lasting time of connection in the table. For example, your
0063 virtual server gets 200 connections per second, the connection lasts
0064 for 200 seconds in average in the connection table, the table size
0065 should be not far less than 200x200, it is good to set the table
0066 size 32768 (2**15).
0067
0068 Another note that each connection occupies 128 bytes effectively and
0069 each hash entry uses 8 bytes, so you can estimate how much memory is
0070 needed for your box.
0071
0072 You can overwrite this number setting conn_tab_bits module parameter
0073 or by appending ip_vs.conn_tab_bits=? to the kernel command line
0074 if IP VS was compiled built-in.
0075
0076 comment "IPVS transport protocol load balancing support"
0077
0078 config IP_VS_PROTO_TCP
0079 bool "TCP load balancing support"
0080 help
0081 This option enables support for load balancing TCP transport
0082 protocol. Say Y if unsure.
0083
0084 config IP_VS_PROTO_UDP
0085 bool "UDP load balancing support"
0086 help
0087 This option enables support for load balancing UDP transport
0088 protocol. Say Y if unsure.
0089
0090 config IP_VS_PROTO_AH_ESP
0091 def_bool IP_VS_PROTO_ESP || IP_VS_PROTO_AH
0092
0093 config IP_VS_PROTO_ESP
0094 bool "ESP load balancing support"
0095 help
0096 This option enables support for load balancing ESP (Encapsulation
0097 Security Payload) transport protocol. Say Y if unsure.
0098
0099 config IP_VS_PROTO_AH
0100 bool "AH load balancing support"
0101 help
0102 This option enables support for load balancing AH (Authentication
0103 Header) transport protocol. Say Y if unsure.
0104
0105 config IP_VS_PROTO_SCTP
0106 bool "SCTP load balancing support"
0107 select LIBCRC32C
0108 help
0109 This option enables support for load balancing SCTP transport
0110 protocol. Say Y if unsure.
0111
0112 comment "IPVS scheduler"
0113
0114 config IP_VS_RR
0115 tristate "round-robin scheduling"
0116 help
0117 The robin-robin scheduling algorithm simply directs network
0118 connections to different real servers in a round-robin manner.
0119
0120 If you want to compile it in kernel, say Y. To compile it as a
0121 module, choose M here. If unsure, say N.
0122
0123 config IP_VS_WRR
0124 tristate "weighted round-robin scheduling"
0125 help
0126 The weighted robin-robin scheduling algorithm directs network
0127 connections to different real servers based on server weights
0128 in a round-robin manner. Servers with higher weights receive
0129 new connections first than those with less weights, and servers
0130 with higher weights get more connections than those with less
0131 weights and servers with equal weights get equal connections.
0132
0133 If you want to compile it in kernel, say Y. To compile it as a
0134 module, choose M here. If unsure, say N.
0135
0136 config IP_VS_LC
0137 tristate "least-connection scheduling"
0138 help
0139 The least-connection scheduling algorithm directs network
0140 connections to the server with the least number of active
0141 connections.
0142
0143 If you want to compile it in kernel, say Y. To compile it as a
0144 module, choose M here. If unsure, say N.
0145
0146 config IP_VS_WLC
0147 tristate "weighted least-connection scheduling"
0148 help
0149 The weighted least-connection scheduling algorithm directs network
0150 connections to the server with the least active connections
0151 normalized by the server weight.
0152
0153 If you want to compile it in kernel, say Y. To compile it as a
0154 module, choose M here. If unsure, say N.
0155
0156 config IP_VS_FO
0157 tristate "weighted failover scheduling"
0158 help
0159 The weighted failover scheduling algorithm directs network
0160 connections to the server with the highest weight that is
0161 currently available.
0162
0163 If you want to compile it in kernel, say Y. To compile it as a
0164 module, choose M here. If unsure, say N.
0165
0166 config IP_VS_OVF
0167 tristate "weighted overflow scheduling"
0168 help
0169 The weighted overflow scheduling algorithm directs network
0170 connections to the server with the highest weight that is
0171 currently available and overflows to the next when active
0172 connections exceed the node's weight.
0173
0174 If you want to compile it in kernel, say Y. To compile it as a
0175 module, choose M here. If unsure, say N.
0176
0177 config IP_VS_LBLC
0178 tristate "locality-based least-connection scheduling"
0179 help
0180 The locality-based least-connection scheduling algorithm is for
0181 destination IP load balancing. It is usually used in cache cluster.
0182 This algorithm usually directs packet destined for an IP address to
0183 its server if the server is alive and under load. If the server is
0184 overloaded (its active connection numbers is larger than its weight)
0185 and there is a server in its half load, then allocate the weighted
0186 least-connection server to this IP address.
0187
0188 If you want to compile it in kernel, say Y. To compile it as a
0189 module, choose M here. If unsure, say N.
0190
0191 config IP_VS_LBLCR
0192 tristate "locality-based least-connection with replication scheduling"
0193 help
0194 The locality-based least-connection with replication scheduling
0195 algorithm is also for destination IP load balancing. It is
0196 usually used in cache cluster. It differs from the LBLC scheduling
0197 as follows: the load balancer maintains mappings from a target
0198 to a set of server nodes that can serve the target. Requests for
0199 a target are assigned to the least-connection node in the target's
0200 server set. If all the node in the server set are over loaded,
0201 it picks up a least-connection node in the cluster and adds it
0202 in the sever set for the target. If the server set has not been
0203 modified for the specified time, the most loaded node is removed
0204 from the server set, in order to avoid high degree of replication.
0205
0206 If you want to compile it in kernel, say Y. To compile it as a
0207 module, choose M here. If unsure, say N.
0208
0209 config IP_VS_DH
0210 tristate "destination hashing scheduling"
0211 help
0212 The destination hashing scheduling algorithm assigns network
0213 connections to the servers through looking up a statically assigned
0214 hash table by their destination IP addresses.
0215
0216 If you want to compile it in kernel, say Y. To compile it as a
0217 module, choose M here. If unsure, say N.
0218
0219 config IP_VS_SH
0220 tristate "source hashing scheduling"
0221 help
0222 The source hashing scheduling algorithm assigns network
0223 connections to the servers through looking up a statically assigned
0224 hash table by their source IP addresses.
0225
0226 If you want to compile it in kernel, say Y. To compile it as a
0227 module, choose M here. If unsure, say N.
0228
0229 config IP_VS_MH
0230 tristate "maglev hashing scheduling"
0231 help
0232 The maglev consistent hashing scheduling algorithm provides the
0233 Google's Maglev hashing algorithm as a IPVS scheduler. It assigns
0234 network connections to the servers through looking up a statically
0235 assigned special hash table called the lookup table. Maglev hashing
0236 is to assign a preference list of all the lookup table positions
0237 to each destination.
0238
0239 Through this operation, The maglev hashing gives an almost equal
0240 share of the lookup table to each of the destinations and provides
0241 minimal disruption by using the lookup table. When the set of
0242 destinations changes, a connection will likely be sent to the same
0243 destination as it was before.
0244
0245 If you want to compile it in kernel, say Y. To compile it as a
0246 module, choose M here. If unsure, say N.
0247
0248 config IP_VS_SED
0249 tristate "shortest expected delay scheduling"
0250 help
0251 The shortest expected delay scheduling algorithm assigns network
0252 connections to the server with the shortest expected delay. The
0253 expected delay that the job will experience is (Ci + 1) / Ui if
0254 sent to the ith server, in which Ci is the number of connections
0255 on the ith server and Ui is the fixed service rate (weight)
0256 of the ith server.
0257
0258 If you want to compile it in kernel, say Y. To compile it as a
0259 module, choose M here. If unsure, say N.
0260
0261 config IP_VS_NQ
0262 tristate "never queue scheduling"
0263 help
0264 The never queue scheduling algorithm adopts a two-speed model.
0265 When there is an idle server available, the job will be sent to
0266 the idle server, instead of waiting for a fast one. When there
0267 is no idle server available, the job will be sent to the server
0268 that minimize its expected delay (The Shortest Expected Delay
0269 scheduling algorithm).
0270
0271 If you want to compile it in kernel, say Y. To compile it as a
0272 module, choose M here. If unsure, say N.
0273
0274 config IP_VS_TWOS
0275 tristate "weighted random twos choice least-connection scheduling"
0276 help
0277 The weighted random twos choice least-connection scheduling
0278 algorithm picks two random real servers and directs network
0279 connections to the server with the least active connections
0280 normalized by the server weight.
0281
0282 If you want to compile it in kernel, say Y. To compile it as a
0283 module, choose M here. If unsure, say N.
0284
0285 comment 'IPVS SH scheduler'
0286
0287 config IP_VS_SH_TAB_BITS
0288 int "IPVS source hashing table size (the Nth power of 2)"
0289 range 4 20
0290 default 8
0291 help
0292 The source hashing scheduler maps source IPs to destinations
0293 stored in a hash table. This table is tiled by each destination
0294 until all slots in the table are filled. When using weights to
0295 allow destinations to receive more connections, the table is
0296 tiled an amount proportional to the weights specified. The table
0297 needs to be large enough to effectively fit all the destinations
0298 multiplied by their respective weights.
0299
0300 comment 'IPVS MH scheduler'
0301
0302 config IP_VS_MH_TAB_INDEX
0303 int "IPVS maglev hashing table index of size (the prime numbers)"
0304 range 8 17
0305 default 12
0306 help
0307 The maglev hashing scheduler maps source IPs to destinations
0308 stored in a hash table. This table is assigned by a preference
0309 list of the positions to each destination until all slots in
0310 the table are filled. The index determines the prime for size of
0311 the table as 251, 509, 1021, 2039, 4093, 8191, 16381, 32749,
0312 65521 or 131071. When using weights to allow destinations to
0313 receive more connections, the table is assigned an amount
0314 proportional to the weights specified. The table needs to be large
0315 enough to effectively fit all the destinations multiplied by their
0316 respective weights.
0317
0318 comment 'IPVS application helper'
0319
0320 config IP_VS_FTP
0321 tristate "FTP protocol helper"
0322 depends on IP_VS_PROTO_TCP && NF_CONNTRACK && NF_NAT && \
0323 NF_CONNTRACK_FTP
0324 select IP_VS_NFCT
0325 help
0326 FTP is a protocol that transfers IP address and/or port number in
0327 the payload. In the virtual server via Network Address Translation,
0328 the IP address and port number of real servers cannot be sent to
0329 clients in ftp connections directly, so FTP protocol helper is
0330 required for tracking the connection and mangling it back to that of
0331 virtual service.
0332
0333 If you want to compile it in kernel, say Y. To compile it as a
0334 module, choose M here. If unsure, say N.
0335
0336 config IP_VS_NFCT
0337 bool "Netfilter connection tracking"
0338 depends on NF_CONNTRACK
0339 help
0340 The Netfilter connection tracking support allows the IPVS
0341 connection state to be exported to the Netfilter framework
0342 for filtering purposes.
0343
0344 config IP_VS_PE_SIP
0345 tristate "SIP persistence engine"
0346 depends on IP_VS_PROTO_UDP
0347 depends on NF_CONNTRACK_SIP
0348 help
0349 Allow persistence based on the SIP Call-ID
0350
0351 endif # IP_VS