]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: config: implement global setting tune.buffers.limit
authorWilly Tarreau <w@1wt.eu>
Tue, 23 Dec 2014 21:52:37 +0000 (22:52 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 24 Dec 2014 22:47:33 +0000 (23:47 +0100)
commit33cb0653480f888e30e9dccd189a7f8b3fd64eb2
treeef269371a235ec710a29052809d2554b4228fea7
parent1058ae73f13aac494d24c89a6820c052e99757a1
MINOR: config: implement global setting tune.buffers.limit

This setting is used to limit memory usage without causing the alloc
failures caused by "-m". Unexpectedly, tests have shown a performance
boost of up to about 18% on HTTP traffic when limiting the number of
buffers to about 10% of the amount of concurrent connections.

tune.buffers.limit <number>
  Sets a hard limit on the number of buffers which may be allocated per process.
  The default value is zero which means unlimited. The minimum non-zero value
  will always be greater than "tune.buffers.reserve" and should ideally always
  be about twice as large. Forcing this value can be particularly useful to
  limit the amount of memory a process may take, while retaining a sane
  behaviour. When this limit is reached, sessions which need a buffer wait for
  another one to be released by another session. Since buffers are dynamically
  allocated and released, the waiting time is very short and not perceptible
  provided that limits remain reasonable. In fact sometimes reducing the limit
  may even increase performance by increasing the CPU cache's efficiency. Tests
  have shown good results on average HTTP traffic with a limit to 1/10 of the
  expected global maxconn setting, which also significantly reduces memory
  usage. The memory savings come from the fact that a number of connections
  will not allocate 2*tune.bufsize. It is best not to touch this value unless
  advised to do so by an haproxy core developer.
doc/configuration.txt
include/types/global.h
src/buffer.c
src/cfgparse.c