blob: b1cfc7c1451850cd98642c7c676c810e29a741f9 [file] [log] [blame]
Willy Tarreaubaaee002006-06-26 02:48:02 +02001/*
Willy Tarreaufd4bffe2020-05-27 14:38:20 +02002 * include/haproxy/defaults.h
Willy Tarreaudeb9ed82010-01-03 21:03:22 +01003 * Miscellaneous default values.
4 *
Willy Tarreaufd4bffe2020-05-27 14:38:20 +02005 * Copyright (C) 2000-2020 Willy Tarreau - w@1wt.eu
Willy Tarreaudeb9ed82010-01-03 21:03:22 +01006 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation, version 2.1
10 * exclusively.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
Willy Tarreaubaaee002006-06-26 02:48:02 +020021
Willy Tarreaufd4bffe2020-05-27 14:38:20 +020022#ifndef _HAPROXY_DEFAULTS_H
23#define _HAPROXY_DEFAULTS_H
Willy Tarreaubaaee002006-06-26 02:48:02 +020024
Willy Tarreauca8b0692020-06-11 08:14:01 +020025/* MAX_THREADS defines the highest limit for the global nbthread value. It
26 * defaults to the number of bits in a long integer when threads are enabled
27 * but may be lowered to save resources on embedded systems.
28*/
29#ifndef USE_THREAD
Willy Tarreauf9662842021-09-13 18:11:26 +020030/* threads disabled, 1 thread max, 1 group max (note: group ids start at 1) */
Willy Tarreauca8b0692020-06-11 08:14:01 +020031#define MAX_THREADS 1
Willy Tarreauca8b0692020-06-11 08:14:01 +020032
Willy Tarreauf9662842021-09-13 18:11:26 +020033#define MAX_TGROUPS 1
34#define MAX_THREADS_PER_GROUP 1
35
Willy Tarreauca8b0692020-06-11 08:14:01 +020036#else
Willy Tarreauf9662842021-09-13 18:11:26 +020037
Willy Tarreau856d56d2022-07-15 21:46:55 +020038/* theoretical limit is 64, though we'd rather not push it too far for now
39 * as some structures might be enlarged to be indexed per group. Let's start
40 * with 16 groups max, allowing to experiment with dual-socket machines
41 * suffering from up to 8 loosely coupled L3 caches. It's a good start and
42 * doesn't engage us too far.
43 */
Willy Tarreauf9662842021-09-13 18:11:26 +020044#ifndef MAX_TGROUPS
Willy Tarreau856d56d2022-07-15 21:46:55 +020045#define MAX_TGROUPS 16
Willy Tarreauf9662842021-09-13 18:11:26 +020046#endif
Willy Tarreau693688e2022-08-06 16:37:27 +020047
Willy Tarreauf9662842021-09-13 18:11:26 +020048#define MAX_THREADS_PER_GROUP LONGBITS
Willy Tarreau693688e2022-08-06 16:37:27 +020049
50/* threads enabled, max_threads defaults to long bits for 1 tgroup or 4 times
51 * long bits if more tgroups are enabled.
52 */
53#ifndef MAX_THREADS
54#define MAX_THREADS ((((MAX_TGROUPS) > 1) ? 4 : 1) * (MAX_THREADS_PER_GROUP))
Willy Tarreauca8b0692020-06-11 08:14:01 +020055#endif
56
Willy Tarreau693688e2022-08-06 16:37:27 +020057#endif // USE_THREAD
58
Willy Tarreaubaaee002006-06-26 02:48:02 +020059/*
60 * BUFSIZE defines the size of a read and write buffer. It is the maximum
Willy Tarreau87b09662015-04-03 00:22:06 +020061 * amount of bytes which can be stored by the proxy for each stream. However,
Willy Tarreaubaaee002006-06-26 02:48:02 +020062 * when reading HTTP headers, the proxy needs some spare space to add or rewrite
63 * headers if needed. The size of this spare is defined with MAXREWRITE. So it
64 * is not possible to process headers longer than BUFSIZE-MAXREWRITE bytes. By
Willy Tarreau27097842015-09-28 13:53:23 +020065 * default, BUFSIZE=16384 bytes and MAXREWRITE=min(1024,BUFSIZE/2), so the
66 * maximum length of headers accepted is 15360 bytes.
Willy Tarreaubaaee002006-06-26 02:48:02 +020067 */
68#ifndef BUFSIZE
69#define BUFSIZE 16384
70#endif
71
Willy Tarreaua24adf02014-11-27 01:11:56 +010072/* certain buffers may only be allocated for responses in order to avoid
73 * deadlocks caused by request queuing. 2 buffers is the absolute minimum
74 * acceptable to ensure that a request gaining access to a server can get
75 * a response buffer even if it doesn't completely flush the request buffer.
76 * The worst case is an applet making use of a request buffer that cannot
77 * completely be sent while the server starts to respond, and all unreserved
78 * buffers are allocated by request buffers from pending connections in the
79 * queue waiting for this one to flush. Both buffers reserved buffers may
80 * thus be used at the same time.
81 */
82#ifndef RESERVED_BUFS
83#define RESERVED_BUFS 2
84#endif
85
Willy Tarreaubaaee002006-06-26 02:48:02 +020086// reserved buffer space for header rewriting
87#ifndef MAXREWRITE
Willy Tarreau27097842015-09-28 13:53:23 +020088#define MAXREWRITE 1024
Willy Tarreaubaaee002006-06-26 02:48:02 +020089#endif
90
Willy Tarreaubf43f6e2013-06-03 15:52:52 +020091#ifndef REQURI_LEN
Willy Tarreaubaaee002006-06-26 02:48:02 +020092#define REQURI_LEN 1024
Willy Tarreaubf43f6e2013-06-03 15:52:52 +020093#endif
94
95#ifndef CAPTURE_LEN
Willy Tarreaubaaee002006-06-26 02:48:02 +020096#define CAPTURE_LEN 64
Willy Tarreaubf43f6e2013-06-03 15:52:52 +020097#endif
Willy Tarreaubaaee002006-06-26 02:48:02 +020098
Willy Tarreau4e957902014-06-27 18:08:49 +020099#ifndef MAX_SYSLOG_LEN
100#define MAX_SYSLOG_LEN 1024
101#endif
102
William Lallemandeba6a542022-09-26 12:54:39 +0200103/* 64kB to archive startup-logs seems way more than enough
104 * /!\ Careful when changing this size, it is used in a shm when exec() from
105 * mworker to wait mode.
106 */
Willy Tarreauaeed4a82020-06-04 22:01:04 +0200107#ifndef STARTUP_LOG_SIZE
108#define STARTUP_LOG_SIZE 65536
109#endif
110
Krzysztof Piotr Oledzkie6bbd742007-11-01 00:33:12 +0100111// maximum line size when parsing config
112#ifndef LINESIZE
113#define LINESIZE 2048
114#endif
115
Willy Tarreaubaaee002006-06-26 02:48:02 +0200116// max # args on a configuration line
Krzysztof Piotr Oledzkie6bbd742007-11-01 00:33:12 +0100117#define MAX_LINE_ARGS 64
Willy Tarreaubaaee002006-06-26 02:48:02 +0200118
Emmanuel Hocdet98263292016-12-29 18:26:15 +0100119// maximum line size when parsing crt-bind-list config
120#define CRT_LINESIZE 65536
121
122// max # args on crt-bind-list configuration line
123#define MAX_CRT_ARGS 2048
Emmanuel Hocdet5e0e6e42016-05-13 11:18:50 +0200124
Willy Tarreauf14c7572021-03-13 10:59:23 +0100125// max # args on a command issued on the CLI ("stats socket")
Willy Tarreau47060b62013-08-01 21:11:42 +0200126// This should cover at least 5 + twice the # of data_types
Willy Tarreauf14c7572021-03-13 10:59:23 +0100127#define MAX_CLI_ARGS 64
Krzysztof Piotr Oledzki2c6962c2008-03-02 02:42:14 +0100128
Willy Tarreaudc70c182021-07-20 17:58:34 +0200129// max recursion levels in config condition evaluations
130// (note that binary operators add one recursion level, and
131// that parenthesis may add two).
132#define MAX_CFG_RECURSION 1024
133
Willy Tarreaubaaee002006-06-26 02:48:02 +0200134// max # of matches per regexp
135#define MAX_MATCH 10
136
Willy Tarreaue5f20dc2006-12-03 15:21:35 +0100137// max # of headers in one HTTP request or response
Willy Tarreauac1932d2011-10-24 19:14:41 +0200138// By default, about 100 headers (+1 for the first line)
Willy Tarreaue5f20dc2006-12-03 15:21:35 +0100139#ifndef MAX_HTTP_HDR
Willy Tarreauac1932d2011-10-24 19:14:41 +0200140#define MAX_HTTP_HDR 101
Willy Tarreaue5f20dc2006-12-03 15:21:35 +0100141#endif
142
Willy Tarreaubce70882009-09-07 11:51:47 +0200143// max # of headers in history when looking for header #-X
144#ifndef MAX_HDR_HISTORY
145#define MAX_HDR_HISTORY 10
146#endif
147
Willy Tarreaub4c84932013-07-23 19:15:30 +0200148// max # of stick counters per session (at least 3 for sc0..sc2)
Willy Tarreaub4c84932013-07-23 19:15:30 +0200149#ifndef MAX_SESS_STKCTR
150#define MAX_SESS_STKCTR 3
151#endif
152
Ilya Shipitsin77e3b4a2020-03-10 12:06:11 +0500153// max # of extra stick-table data types that can be registered at runtime
Willy Tarreauedee1d62014-07-15 16:44:27 +0200154#ifndef STKTABLE_EXTRA_DATA_TYPES
155#define STKTABLE_EXTRA_DATA_TYPES 0
156#endif
157
Adis Nezirovic1a693fc2020-01-16 15:19:29 +0100158// max # of stick-table filter entries that can be used during dump
159#ifndef STKTABLE_FILTER_LEN
160#define STKTABLE_FILTER_LEN 4
161#endif
162
Willy Tarreaub8949f12007-03-23 22:39:59 +0100163// max # of loops we can perform around a read() which succeeds.
164// It's very frequent that the system returns a few TCP segments at a time.
165#ifndef MAX_READ_POLL_LOOPS
166#define MAX_READ_POLL_LOOPS 4
167#endif
168
Willy Tarreau6f4a82c2009-03-21 20:43:57 +0100169// minimum number of bytes read at once above which we don't try to read
170// more, in order not to risk facing an EAGAIN. Most often, if we read
171// at least 10 kB, we can consider that the system has tried to read a
172// full buffer and got multiple segments (>1 MSS for jumbo frames, >7 MSS
173// for normal frames) did not bother truncating the last segment.
174#ifndef MIN_RECV_AT_ONCE_ENOUGH
175#define MIN_RECV_AT_ONCE_ENOUGH (7*1448)
176#endif
177
Willy Tarreau14acc702011-05-11 20:47:24 +0200178// The minimum number of bytes to be forwarded that is worth trying to splice.
179// Below 4kB, it's not worth allocating pipes nor pretending to zero-copy.
180#ifndef MIN_SPLICE_FORWARD
181#define MIN_SPLICE_FORWARD 4096
182#endif
183
Willy Tarreau1db37712007-06-03 17:16:49 +0200184// the max number of events returned in one call to poll/epoll. Too small a
185// value will cause lots of calls, and too high a value may cause high latency.
186#ifndef MAX_POLL_EVENTS
187#define MAX_POLL_EVENTS 200
188#endif
189
Willy Tarreau561958c2021-10-06 19:36:47 +0200190/* eternity when exprimed in timeval */
191#ifndef TV_ETERNITY
192#define TV_ETERNITY (~0UL)
193#endif
194
195/* eternity when exprimed in ms */
196#ifndef TV_ETERNITY_MS
197#define TV_ETERNITY_MS (-1)
198#endif
199
200/* we want to be able to detect time jumps. Fix the maximum wait time to a low
201 * value so that we know the time has changed if we wait longer.
202 */
203#ifndef MAX_DELAY_MS
204#define MAX_DELAY_MS 60000
205#endif
206
Willy Tarreau66161322021-02-19 15:50:27 +0100207// The maximum number of connections accepted at once by a thread for a single
208// listener. It used to default to 64 divided by the number of processes but
209// the tasklet-based model is much more scalable and benefits from smaller
210// values. Experimentation has shown that 4 gives the highest accept rate for
211// all thread values, and that 3 and 5 come very close, as shown below (HTTP/1
212// connections forwarded per second at multi-accept 4 and 64):
213//
214// ac\thr| 1 2 4 8 16
215// ------+------------------------------
216// 4| 80k 106k 168k 270k 336k
217// 64| 63k 89k 145k 230k 274k
218//
219#ifndef MAX_ACCEPT
220#define MAX_ACCEPT 4
221#endif
222
Willy Tarreau060a7612021-03-10 11:06:26 +0100223// The base max number of tasks to run at once to be used when not set by
224// tune.runqueue-depth. It will automatically be divided by the square root
225// of the number of threads for better fairness. As such, 64 threads will
226// use 35 and a single thread will use 280.
Olivier Houchard1599b802018-05-24 18:59:04 +0200227#ifndef RUNQUEUE_DEPTH
Willy Tarreau060a7612021-03-10 11:06:26 +0100228#define RUNQUEUE_DEPTH 280
Olivier Houchard1599b802018-05-24 18:59:04 +0200229#endif
230
Ilya Shipitsin77e3b4a2020-03-10 12:06:11 +0500231// cookie delimiter in "prefix" mode. This character is inserted between the
Lukas Tribus23953682017-04-28 13:24:30 +0000232// persistence cookie and the original value. The '~' is allowed by RFC6265,
Willy Tarreaubaaee002006-06-26 02:48:02 +0200233// and should not be too common in server names.
234#ifndef COOKIE_DELIM
235#define COOKIE_DELIM '~'
236#endif
237
Ilya Shipitsin77e3b4a2020-03-10 12:06:11 +0500238// this delimiter is used between a server's name and a last visit date in
Willy Tarreaubca99692010-10-06 19:25:55 +0200239// cookies exchanged with the client.
240#ifndef COOKIE_DELIM_DATE
241#define COOKIE_DELIM_DATE '|'
242#endif
243
Willy Tarreaubaaee002006-06-26 02:48:02 +0200244#define CONN_RETRIES 3
245
246#define CHK_CONNTIME 2000
247#define DEF_CHKINTR 2000
Pieter Baauw46af1702016-02-12 14:35:20 +0100248#define DEF_MAILALERTTIME 10000
Willy Tarreaubaaee002006-06-26 02:48:02 +0200249#define DEF_FALLTIME 3
250#define DEF_RISETIME 2
Simon Horman58c32972013-11-25 10:46:38 +0900251#define DEF_AGENT_FALLTIME 1
252#define DEF_AGENT_RISETIME 1
Simon Horman98637e52014-06-20 12:30:16 +0900253#define DEF_CHECK_PATH ""
Christopher Faulet33f05df2020-04-01 11:08:50 +0200254
Willy Tarreaubaaee002006-06-26 02:48:02 +0200255
Krzysztof Piotr Oledzki97f07b82009-12-15 22:31:24 +0100256#define DEF_HANA_ONERR HANA_ONERR_FAILCHK
257#define DEF_HANA_ERRLIMIT 10
258
Ross Westaf72a1d2008-08-03 10:51:45 +0200259// X-Forwarded-For header default
260#define DEF_XFORWARDFOR_HDR "X-Forwarded-For"
261
Maik Broemme2850cb42009-04-17 18:53:21 +0200262// X-Original-To header default
263#define DEF_XORIGINALTO_HDR "X-Original-To"
264
Willy Tarreaubaaee002006-06-26 02:48:02 +0200265/* Default connections limit.
266 *
267 * A system limit can be enforced at build time in order to avoid using haproxy
268 * beyond reasonable system limits. For this, just define SYSTEM_MAXCONN to the
269 * absolute limit accepted by the system. If the configuration specifies a
270 * higher value, it will be capped to SYSTEM_MAXCONN and a warning will be
271 * emitted. The only way to override this limit will be to set it via the
Willy Tarreaudf23c0c2019-03-13 10:10:49 +0100272 * command-line '-n' argument. If SYSTEM_MAXCONN is not set, a minimum value
273 * of 100 will be used for DEFAULT_MAXCONN which almost guarantees that a
274 * process will correctly start in any situation.
Willy Tarreaubaaee002006-06-26 02:48:02 +0200275 */
Willy Tarreauca783d42019-03-13 10:03:07 +0100276#ifdef SYSTEM_MAXCONN
Willy Tarreauc9fe4562009-06-15 16:33:36 +0200277#undef DEFAULT_MAXCONN
Willy Tarreaubaaee002006-06-26 02:48:02 +0200278#define DEFAULT_MAXCONN SYSTEM_MAXCONN
Willy Tarreaudf23c0c2019-03-13 10:10:49 +0100279#elif !defined(DEFAULT_MAXCONN)
280#define DEFAULT_MAXCONN 100
Willy Tarreaubaaee002006-06-26 02:48:02 +0200281#endif
282
Willy Tarreau2c43a1e2007-10-14 23:05:39 +0200283/* Minimum check interval for spread health checks. Servers with intervals
284 * greater than or equal to this value will have their checks spread apart
285 * and will be considered when searching the minimal interval.
286 * Others will be ignored for the minimal interval and will have their checks
287 * scheduled on a different basis.
288 */
289#ifndef SRV_CHK_INTER_THRES
290#define SRV_CHK_INTER_THRES 1000
291#endif
292
Krzysztof Oledzkid9db9272007-10-15 10:05:11 +0200293/* Specifies the string used to report the version and release date on the
294 * statistics page. May be defined to the empty string ("") to permanently
295 * disable the feature.
296 */
297#ifndef STATS_VERSION_STRING
298#define STATS_VERSION_STRING " version " HAPROXY_VERSION ", released " HAPROXY_DATE
299#endif
300
Willy Tarreauac13aea2020-06-04 10:36:03 +0200301/* This is the default statistics URI */
302#ifdef CONFIG_STATS_DEFAULT_URI
303#define STATS_DEFAULT_URI CONFIG_STATS_DEFAULT_URI
304#else
305#define STATS_DEFAULT_URI "/haproxy?stats"
306#endif
307
308/* This is the default statistics realm */
309#ifdef CONFIG_STATS_DEFAULT_REALM
310#define STATS_DEFAULT_REALM CONFIG_STATS_DEFAULT_REALM
311#else
312#define STATS_DEFAULT_REALM "HAProxy Statistics"
313#endif
314
Willy Tarreau8f38bd02009-05-10 08:53:33 +0200315/* Maximum signal queue size, and also number of different signals we can
316 * handle.
317 */
318#ifndef MAX_SIGNAL
319#define MAX_SIGNAL 256
320#endif
321
Willy Tarreau3ad6a762009-08-16 10:08:02 +0200322/* Maximum host name length */
323#ifndef MAX_HOSTNAME_LEN
Willy Tarreau33056432021-08-28 12:05:32 +0200324#ifdef MAXHOSTNAMELEN
Willy Tarreau75abcb32015-01-14 11:48:58 +0100325#define MAX_HOSTNAME_LEN MAXHOSTNAMELEN
326#else
327#define MAX_HOSTNAME_LEN 64
328#endif // MAXHOSTNAMELEN
329#endif // MAX_HOSTNAME_LEN
Willy Tarreau3ad6a762009-08-16 10:08:02 +0200330
Krzysztof Piotr Oledzkif7089f52009-10-10 21:06:49 +0200331/* Maximum health check description length */
332#ifndef HCHK_DESC_LEN
333#define HCHK_DESC_LEN 128
334#endif
335
Emeric Brun76d88952012-10-05 15:47:31 +0200336/* ciphers used as defaults on connect */
337#ifndef CONNECT_DEFAULT_CIPHERS
338#define CONNECT_DEFAULT_CIPHERS NULL
339#endif
340
Dirkjan Bussink415150f2018-09-14 11:14:21 +0200341/* ciphers used as defaults on TLS 1.3 connect */
342#ifndef CONNECT_DEFAULT_CIPHERSUITES
343#define CONNECT_DEFAULT_CIPHERSUITES NULL
344#endif
345
Emeric Brun76d88952012-10-05 15:47:31 +0200346/* ciphers used as defaults on listeners */
347#ifndef LISTEN_DEFAULT_CIPHERS
348#define LISTEN_DEFAULT_CIPHERS NULL
349#endif
350
Dirkjan Bussink415150f2018-09-14 11:14:21 +0200351/* cipher suites used as defaults on TLS 1.3 listeners */
352#ifndef LISTEN_DEFAULT_CIPHERSUITES
353#define LISTEN_DEFAULT_CIPHERSUITES NULL
354#endif
355
Emeric Brun6924ef82013-03-06 14:08:53 +0100356/* named curve used as defaults for ECDHE ciphers */
357#ifndef ECDHE_DEFAULT_CURVE
358#define ECDHE_DEFAULT_CURVE "prime256v1"
359#endif
360
Emeric Brun46635772012-11-14 11:32:56 +0100361/* ssl cache size */
362#ifndef SSLCACHESIZE
363#define SSLCACHESIZE 20000
364#endif
365
Remi Gacognef46cd6e2014-06-12 14:58:40 +0200366/* ssl max dh param size */
367#ifndef SSL_DEFAULT_DH_PARAM
Remi Tricot-Le Breton1d6338e2022-04-12 11:31:55 +0200368#define SSL_DEFAULT_DH_PARAM 0
Remi Gacognef46cd6e2014-06-12 14:58:40 +0200369#endif
370
Willy Tarreaud92aa5c2015-01-15 21:34:39 +0100371/* max memory cost per SSL session */
372#ifndef SSL_SESSION_MAX_COST
373#define SSL_SESSION_MAX_COST (16*1024) // measured
374#endif
375
376/* max memory cost per SSL handshake (on top of session) */
377#ifndef SSL_HANDSHAKE_MAX_COST
378#define SSL_HANDSHAKE_MAX_COST (76*1024) // measured
379#endif
Willy Tarreaud0256482015-01-15 21:45:22 +0100380
Christopher Faulet31af49d2015-06-09 17:29:50 +0200381#ifndef DEFAULT_SSL_CTX_CACHE
382#define DEFAULT_SSL_CTX_CACHE 1000
383#endif
384
Willy Tarreau87b09662015-04-03 00:22:06 +0200385/* approximate stream size (for maxconn estimate) */
386#ifndef STREAM_MAX_COST
387#define STREAM_MAX_COST (sizeof(struct stream) + \
Willy Tarreaud0256482015-01-15 21:45:22 +0100388 2 * sizeof(struct channel) + \
389 2 * sizeof(struct connection) + \
Stéphane Cottin23e9e932017-05-18 08:58:41 +0200390 global.tune.requri_len + \
Willy Tarreaud0256482015-01-15 21:45:22 +0100391 2 * global.tune.cookie_len)
392#endif
393
394/* available memory estimate : count about 3% of overhead in various structures */
395#ifndef MEM_USABLE_RATIO
396#define MEM_USABLE_RATIO 0.97
Willy Tarreaud92aa5c2015-01-15 21:34:39 +0100397#endif
398
Willy Tarreaub61fccd2022-02-17 17:15:02 +0100399/* if not 0, maximum allocatable memory per process in MB */
400#ifndef HAPROXY_MEMMAX
401#define HAPROXY_MEMMAX 0
402#endif
403
Willy Tarreau197715a2022-04-25 19:29:10 +0200404/* For USE_ZLIB, DEFAULT_MAXZLIBMEM may be set to a hard-coded value that will
405 * preset a maxzlibmem value. Just leave it to zero for other configurations.
406 * Note that it's expressed in megabytes.
407 */
408#if !defined(DEFAULT_MAXZLIBMEM) || !defined(USE_ZLIB)
409#undef DEFAULT_MAXZLIBMEM
410#define DEFAULT_MAXZLIBMEM 0
411#endif
412
Willy Tarreau8de6dc92021-09-27 19:29:30 +0200413/* On modern architectures with many threads, a fast memory allocator, and
414 * local pools, the global pools with their single list can be way slower than
415 * the standard allocator which already has its own per-thread arenas. In this
416 * case we disable global pools. The global pools may still be enforced
417 * using CONFIG_HAP_GLOBAL_POOLS though.
418 */
419#if defined(USE_THREAD) && defined(HA_HAVE_FAST_MALLOC) && !defined(CONFIG_HAP_GLOBAL_POOLS)
420#define CONFIG_HAP_NO_GLOBAL_POOLS
421#endif
422
Willy Tarreau3bc4e8b2020-05-09 09:02:35 +0200423/* default per-thread pool cache size when enabled */
424#ifndef CONFIG_HAP_POOL_CACHE_SIZE
Willy Tarreauf5e94b22022-01-02 19:38:54 +0100425#define CONFIG_HAP_POOL_CACHE_SIZE 524288
Willy Tarreau3bc4e8b2020-05-09 09:02:35 +0200426#endif
427
Willy Tarreau43937e92022-01-02 17:24:55 +0100428#ifndef CONFIG_HAP_POOL_CLUSTER_SIZE
429#define CONFIG_HAP_POOL_CLUSTER_SIZE 8
430#endif
431
Willy Tarreau4bfc5802014-06-17 12:19:18 +0200432/* Number of samples used to compute the times reported in stats. A power of
433 * two is highly recommended, and this value multiplied by the largest response
434 * time must not overflow and unsigned int. See freq_ctr.h for more information.
435 * We consider that values are accurate to 95% with two batches of samples below,
436 * so in order to advertise accurate times across 1k samples, we effectively
437 * measure over 512.
438 */
439#ifndef TIME_STATS_SAMPLES
440#define TIME_STATS_SAMPLES 512
441#endif
442
Emeric Brun4147b2e2014-06-16 18:36:30 +0200443/* max ocsp cert id asn1 encoded length */
444#ifndef OCSP_MAX_CERTID_ASN1_LENGTH
445#define OCSP_MAX_CERTID_ASN1_LENGTH 128
446#endif
447
Emeric Brunc8b27b62014-06-19 14:16:17 +0200448#ifndef OCSP_MAX_RESPONSE_TIME_SKEW
449#define OCSP_MAX_RESPONSE_TIME_SKEW 300
450#endif
Nenad Merdanovic05552d42015-02-27 19:56:49 +0100451
452/* Number of TLS tickets to check, used for rotation */
453#ifndef TLS_TICKETS_NO
454#define TLS_TICKETS_NO 3
455#endif
Willy Tarreauf3045d22015-04-29 16:24:50 +0200456
457/* pattern lookup default cache size, in number of entries :
458 * 10k entries at 10k req/s mean 1% risk of a collision after 60 years, that's
459 * already much less than the memory's reliability in most machines and more
460 * durable than most admin's life expectancy. A collision will result in a
461 * valid result to be returned for a different entry from the same list.
462 */
463#ifndef DEFAULT_PAT_LRU_SIZE
464#define DEFAULT_PAT_LRU_SIZE 10000
465#endif
466
Willy Tarreau0f6ffd62020-06-03 19:33:00 +0200467/* maximum number of pollers that may be registered */
468#ifndef MAX_POLLERS
469#define MAX_POLLERS 10
470#endif
471
Amaury Denoyelleb56a7c82021-03-26 18:20:47 +0100472/* system sysfs directory */
473#define NUMA_DETECT_SYSTEM_SYSFS_PATH "/sys/devices/system"
474
Willy Tarreaufd4bffe2020-05-27 14:38:20 +0200475#endif /* _HAPROXY_DEFAULTS_H */