]> git.ipfire.org Git - thirdparty/haproxy.git/log
thirdparty/haproxy.git
17 years ago[MAJOR] added a new state to listeners
Willy Tarreau [Sun, 28 Oct 2007 20:59:24 +0000 (21:59 +0100)] 
[MAJOR] added a new state to listeners

There was a missing state for listeners, when they are not listening
but still attached to the protocol. The LI_ASSIGNED state was added
for this purpose. This permitted to clean up the assignment/release
workflow quite a bit. Generic enable/enable_all/disable/disable_all
primitives were added, and a disable_all entry was added to the
struct protocol.

17 years ago[MINOR] add an options field to the listeners
Willy Tarreau [Sun, 28 Oct 2007 16:02:33 +0000 (17:02 +0100)] 
[MINOR] add an options field to the listeners

17 years ago[MEDIUM] simplify error path in event_accept()
Willy Tarreau [Sun, 4 Nov 2007 16:51:50 +0000 (17:51 +0100)] 
[MEDIUM] simplify error path in event_accept()

The error path in event_accept() was complicated by many code
duplications. Use the classical unrolling with the gotos. This
fix alone reduced the code by 2.5 kB.

17 years ago[MINOR] avoid calling some layer7 functions if not needed
Willy Tarreau [Sun, 4 Nov 2007 18:30:00 +0000 (19:30 +0100)] 
[MINOR] avoid calling some layer7 functions if not needed

Small optimization: in some cases, it's not interesting to call
functions which are dedicated to checking the cache headers or
cookies. Avoid calling them when not necessary.

17 years ago[MINOR] adjust error messages about conflicting proxies
Willy Tarreau [Sun, 4 Nov 2007 06:04:43 +0000 (07:04 +0100)] 
[MINOR] adjust error messages about conflicting proxies

It's not easy to report useful information to help the user quickly
fix a configuration. This patch :
  - removes the word "listener" in favor of "proxy" as it has been
    used since the beginning ;

  - ensures that the same function (hence the same words) will be
    used to report capabilities of a proxy being declared and an
    existing proxy ;

  - avoid the term "conflicting capabilities" in favor of "overlapping
    capabilities" which is more exact.

  - just report that the same name is reused in case of warnings

17 years ago[MEDIUM] Implement and use generic findproxy and relax duplicated proxy check
Krzysztof Piotr Oledzki [Sat, 3 Nov 2007 22:41:58 +0000 (23:41 +0100)] 
[MEDIUM] Implement and use generic findproxy and relax duplicated proxy check

This patch:
 - adds proxy_mode_str() similar to proxy_type_str()
 - adds a generic findproxy function used with default_backend/setbe/use_backed
 - rewrite default_backend/senbe/use_backed to use introduced findproxy()
 - relaxes duplicated proxy check
 - changes capabilities displaying from "%X" to "%s" with a call to proxy_type_str()

17 years ago[BUILD] disable warning about localtime_r on Solaris
Willy Tarreau [Sat, 3 Nov 2007 15:18:11 +0000 (16:18 +0100)] 
[BUILD] disable warning about localtime_r on Solaris

Solaris only declares localtime_r() if _REENTRANT is defined. Update
the makefile to silent the warning.

17 years ago[MEDIUM] make default_backend work in TCP mode too
Willy Tarreau [Sat, 3 Nov 2007 13:28:39 +0000 (14:28 +0100)] 
[MEDIUM] make default_backend work in TCP mode too

The default_backend did not work in TCP mode since there was no
header state to assign the backend. This causes much trouble when
configs are created by copy-paste.

The solution was to fix the way the backend is assigned upon accept().
A wrong contimeout assignment was fixed too.

17 years ago[MEDIUM] introduce the "url_param" balance method
Willy Tarreau [Thu, 1 Nov 2007 21:48:15 +0000 (22:48 +0100)] 
[MEDIUM] introduce the "url_param" balance method

Some applications do not have a strict persistence requirement, yet
it is still desirable for performance considerations, due to local
caches on the servers. For some reasons, there are some applications
which cannot rely on cookies, and for which the last resort is to use
a parameter passed in the URL.

The new 'url_param' balance method is there to solve this issue. It
accepts a parameter name which is looked up from the URL and which
is then hashed to select a server. If the parameter is not found,
then the round robin algorithm is used in order to provide a normal
load balancing across the servers for the first requests. It would
have been possible to use a source IP hash instead, but since such
applications are generally buried behind multiple levels of
reverse-proxies, it would not provide a good balance.

The doc has been updated, and two regression testing configurations
have been added.

17 years ago[MINOR] externalize the "balance" option parser to backend.c
Willy Tarreau [Thu, 1 Nov 2007 20:39:54 +0000 (21:39 +0100)] 
[MINOR] externalize the "balance" option parser to backend.c

A new function "backend_parse_balance" has been created in backend.c,
which is dedicated to the parsing of the "balance" keyword. It will
provide easier methods for adding new algorithms.

17 years ago[CLEANUP] group PR_O_BALANCE_* bits into a checkable value
Willy Tarreau [Thu, 1 Nov 2007 20:08:19 +0000 (21:08 +0100)] 
[CLEANUP] group PR_O_BALANCE_* bits into a checkable value

In preparation for newer balance algorithms, group the
sparse PR_O_BALANCE_* values into layer4 and layer7-based
algorithms. This will ease addition of newer algorithms.

17 years ago[MEDIUM] Handle long lines properly
Krzysztof Piotr Oledzki [Wed, 31 Oct 2007 23:33:12 +0000 (00:33 +0100)] 
[MEDIUM] Handle long lines properly

Currently, there is a hidden line length limit in the haproxy, set
to 256-1 chars. With large acls (for example many hdr(host) matches)
it may be not enough and which is even worse, error message may
be totally confusing as everything above this limit is treated
as a next line:

echo -ne "frontend aqq 1.2.3.4:80\nmode http\nacl e hdr(host) -i X X X X X X X www.xx.example.com stats\n"|
 sed s/X/www.some-host-name.example.com/g > ha.cfg && haproxy -c -f ./ha.cfg

[WARNING] 300/163906 (11342) : parsing [./ha.cfg:4] : 'stats' ignored because frontend 'aqq' has no backend capability.

Recently I hit simmilar problem and it took me a while to find why
requests for "stats" are not handled properly.

This patch:
 - makes the limit configurable (LINESIZE)
 - increases default line length limit from 256 to 2048
 - increases MAX_LINE_ARGS from 40 to 64
 - fixes hidden assignment in fgets()
 - moves arg/end/args/line inside the loop, making code auditing easier
 - adds a check that shows error if the limit is reached
 - changes "*line++ = 0;" to "*line++ = '\0';" (cosmetics)

With this patch, when LINESIZE is defined to 256, above example produces:
[ALERT] 300/164724 (27364) : parsing [/tmp/ha.cfg:3]: line too long, limit: 255.
[ALERT] 300/164724 (27364) : Error reading configuration file : /tmp/ha.cfg

17 years ago[PATCH] use backends only with use_backend directive
Krzysztof Oledzki [Wed, 31 Oct 2007 08:07:24 +0000 (09:07 +0100)] 
[PATCH] use backends only with use_backend directive

Hello,

As it is possible to use the same name for two proxies, make sure that
use_backed & friends does not match wrong proxy when used with use_backend/
default_backend/setbe. For example, without this patch, when there is a
backend and frontend with the same name (first backend and then frontend
trying to use specific backend), the application will likely try to use
frontend instead of backend, complaining loudly about a loop.

Best regards,

                                 Krzysztof Oledzki

17 years ago[MINOR] add socket address length to the protocols
Willy Tarreau [Sun, 28 Oct 2007 11:09:45 +0000 (12:09 +0100)] 
[MINOR] add socket address length to the protocols

The protocol struct can be more useful if it also provides
address lengths. Add sock_addrlen, as used by bind(), as
well as l3_addrlen for hashes.

17 years ago[CLEANUP] silent warning about LIST_* being redefined on OpenBSD
Willy Tarreau [Sun, 28 Oct 2007 10:41:06 +0000 (11:41 +0100)] 
[CLEANUP] silent warning about LIST_* being redefined on OpenBSD

Building ev_kqueue on OpenBSD causes some warnings to occur,
because OpenBSD also uses LIST_* macros in sys/queue.h, included
from sys/event.h. Simply undefine those macros since we don't
need them.

17 years ago[MINOR] move error codes to common/errors.h
Willy Tarreau [Sun, 28 Oct 2007 10:14:07 +0000 (11:14 +0100)] 
[MINOR] move error codes to common/errors.h

It's useful to be able to share error codes between C files,
so move the codes currently only used in protocols to a generic
file.

17 years ago[TESTS] add a simple test for the status page
Willy Tarreau [Thu, 25 Oct 2007 18:17:40 +0000 (20:17 +0200)] 
[TESTS] add a simple test for the status page

17 years ago[MEDIUM] add support for "maxqueue" to limit server queue overload
Elijah Epifanov [Thu, 25 Oct 2007 18:15:38 +0000 (20:15 +0200)] 
[MEDIUM] add support for "maxqueue" to limit server queue overload

This patch adds the "maxqueue" parameter to the server. This allows new
sessions to be immediately rebalanced when the server's queue is filled.
It's useful when session stickiness is just a performance boost (even a
huge one) but not a requirement.

This should only be used if session affinity isn't a hard functional
requirement but provides performance boost by keeping server-local
caches hot and compact).

Absence of 'maxqueue' option means unlimited queue. When queue gets filled
up to 'maxqueue' client session is moved from server-local queue to a global
one.

17 years ago[MINOR] provide easy-to-use limit_r and LIM2A* macros
Willy Tarreau [Thu, 25 Oct 2007 14:58:42 +0000 (16:58 +0200)] 
[MINOR] provide easy-to-use limit_r and LIM2A* macros

This is in fact the same as ultoa() except that it's possible to
pass the string to be returned in case the value is NULL. This is
useful to report limits in printf calls.

17 years ago[MINOR] provide easier-to-use ultoa_* functions
Willy Tarreau [Thu, 25 Oct 2007 10:14:10 +0000 (12:14 +0200)] 
[MINOR] provide easier-to-use ultoa_* functions

Current ultoa() function is limited to one use per expression or
function call. Sometimes this is limitating. Change this in favor
of an array of 10 return values and shorter macros U2A0..U2A9
which respectively call the function with the 10 different buffers.

17 years ago[BUG] fix calls to localtime()
Willy Tarreau [Thu, 25 Oct 2007 08:34:16 +0000 (10:34 +0200)] 
[BUG] fix calls to localtime()

localtime() was called with pointers to tv_sec, which is time_t on
some platforms and long on others. A problem was encountered on
Sparc64 under OpenBSD where tv_sec is long (64 bits) and time_t is
32 bits. Since this architecture is big-endian, it exhibited the
bug because localtime() always worked with the high part of the
value which is always zero. This problem was identified and debugged
by Thierry Fournier.

The correct solution is to pass the date by value and not by pointer,
through an intermediate function. The use of localtime_r() instead of
localtime() also made it possible to get rid of the first call to
localtime() since it does not need to allocate memory anymore.

17 years ago[BUG] fix error checking in strl2ic/strl2uic()
Willy Tarreau [Thu, 25 Oct 2007 07:42:24 +0000 (09:42 +0200)] 
[BUG] fix error checking in strl2ic/strl2uic()

The strl2ic() and strl2uic() primitives used to convert string to
integers could return 10 times the value read if they stopped on
non-digit because of a mis-placed loop exit.

17 years ago[MEDIUM] stats: report server and backend cumulated downtime
Krzysztof Oledzki [Mon, 22 Oct 2007 14:21:10 +0000 (16:21 +0200)] 
[MEDIUM] stats: report server and backend cumulated downtime

Hello,

This patch implements new statistics for SLA calculation by adding new
field 'Dwntime' with total down time since restart (both HTTP/CSV) and
extending status field (HTTP) or inserting a new one (CSV) with time
showing how long each server/backend is in a current state. Additionaly,
down transations are also calculated and displayed for backends, so it is
possible to know how many times selected backend was down, generating "No
server is available to handle this request." error.

New information are presentetd in two different ways:
   - for HTTP: a "human redable form", one of "100000d 23h", "23h 59m" or
      "59m 59s"
   - for CSV: seconds

I believe that seconds resolution is enough.

As there are more columns in the status page I decided to shrink some
names to make more space:
   - Weight -> Wght
   - Check -> Chk
   - Down -> Dwn

Making described changes I also made some improvements and fixed some
small bugs:
   - don't increment s->health above 's->rise + s->fall - 1'. Previously it
     was incremented an then (re)set to 's->rise + s->fall - 1'.
   - do not set server down if it is down already
   - do not set server up if it is up already
   - fix colspan in multiple places (mostly introduced by my previous patch)
   - add missing "status" header to CSV
   - fix order of retries/redispatches in server (CSV)
   - s/Tthen/Then/
   - s/server/backend/ in DATA_ST_PX_BE (dumpstats.c)

Changes from previous version:
  - deal with negative time intervales
  - don't relay on s->state (SRV_RUNNING)
  - little reworked human_time + compacted format (no spaces). If needed it
    can be used in the future for other purposes by optionally making "cnt"
    as an argument
  - leave set_server_down mostly unchanged
  - only little reworked "process_chk: 9"
  - additional fields in CSV are appended to the rigth
  - fix "SEC" macro
  - named arguments (human_time, be_downtime, srv_downtime)

Hope it is OK. If there are only cosmetic changes needed please fill free
to correct it, however if there are some bigger changes required I would
like to discuss it first or at last to know what exactly was changed
especially since I already put this patch into my production server. :)

Thank you,

Best regards,

  Krzysztof Oledzki

17 years ago[PATCH]: Check for duplicated conflicting proxies
Krzysztof Oledzki [Sun, 21 Oct 2007 00:55:17 +0000 (02:55 +0200)] 
[PATCH]: Check for duplicated conflicting proxies

Currently haproxy accepts a config with duplicated proxies
(listen/fronted/backed/ruleset). This patch fix this, so the application
will complain when there is an error.

With this modification it is still possible to use the same name for two
proxies (for example frontend&backend) as long there is no conflict:

                 listen backend frontend ruleset
listen             -      -       -        -
backend            -      -       OK       -
frontend           -      OK      -        -
ruleset            -      -       -        -

Best regards,

  Krzysztof Oledzki

17 years ago[MINOR] stats: update the width of the table to 22 columns
Willy Tarreau [Fri, 19 Oct 2007 04:23:19 +0000 (06:23 +0200)] 
[MINOR] stats: update the width of the table to 22 columns

Unfortunately, we forgot to increase the table from 20 to 22 cols when
we added retries and redisp.

17 years ago[RELEASE] Released version 1.3.13 with the following main changes : v1.3.13
Willy Tarreau [Thu, 18 Oct 2007 20:38:22 +0000 (22:38 +0200)] 
[RELEASE] Released version 1.3.13 with the following main changes :
    - replace the code under O'Reilly license (Arnaud Cornet)
    - add a small man page (Arnaud Cornet)
    - stats: report haproxy's version by default (Krzysztof Oledzki)
    - stats: count server retries and redispatches (Krzysztof Oledzki)
    - core: added easy support for Doug Lea's malloc (dlmalloc)
    - core: fade out memory usage when stopping proxies
    - core: moved the sockaddr pointer to the fdtab structure
    - core: add generic protocol support
    - core: implement client-side support for PF_UNIX sockets
    - stats: implement the CSV output
    - stats: add a link to the CSV export HTML page
    - stats: implement the statistics output on a unix socket
    - config: introduce the "stats" keyword in global section
    - build: centralize version and date into one file for each
    - tests: added a new hash algorithm

17 years ago[MEDIUM] stats: count server retries and redispatches
Krzysztof Oledzki [Thu, 18 Oct 2007 17:12:30 +0000 (19:12 +0200)] 
[MEDIUM] stats: count server retries and redispatches

It is important to know how your installation performs. Haproxy masks
connection errors, which is extremely good for a client but it is bad for
an administrator (except people believing that "ignorance is a bless").

Attached patch adds retries and redispatches counters, so now haproxy:

1. For server:
 - counts retried connections (masked or not)

2. For backends:
 - counts retried connections (masked or not) that happened to
    a slave server
 - counts redispatched connections
 - does not count successfully redispatched connections as backend errors.
    Errors are increased only when client does not get a valid response,
    in other words: with failed redispatch or when this function is not
    enabled.

3. For statistics:
 - display Retr (retries) and Redis (redispatches) as a "Warning"
   information.

17 years ago[MINOR] use nolinger on health-checks if backend is set to nolinger
Willy Tarreau [Thu, 18 Oct 2007 16:07:48 +0000 (18:07 +0200)] 
[MINOR] use nolinger on health-checks if backend is set to nolinger

If the administrator finds it useful to disable lingering on the backend,
let's disable lingering on health-checks too.

17 years ago[BUG] scope "." must match the backend and not the frontend
Willy Tarreau [Thu, 18 Oct 2007 14:38:37 +0000 (16:38 +0200)] 
[BUG] scope "." must match the backend and not the frontend

17 years ago[BUG] fix off-by-one in path length in destroy_uxst_socket()
Willy Tarreau [Thu, 18 Oct 2007 14:15:52 +0000 (16:15 +0200)] 
[BUG] fix off-by-one in path length in destroy_uxst_socket()

An off-by-one error was left in the computation of the unix socket path.

17 years ago[BUILD] fix build of global section with older gcc versions
Willy Tarreau [Thu, 18 Oct 2007 13:15:57 +0000 (15:15 +0200)] 
[BUILD] fix build of global section with older gcc versions

The way the global section was initialized was not correct, which
made older versions of GCC complain.

17 years ago[MEDIUM] introduce the "stats" keyword in global section
Willy Tarreau [Thu, 18 Oct 2007 11:53:22 +0000 (13:53 +0200)] 
[MEDIUM] introduce the "stats" keyword in global section

Removed old unused MODE_LOG and MODE_STATS, and replaced the "stats"
keyword in the global section. The new "stats" keyword in the global
section is used to create a UNIX socket on which the statistics will
be accessed.  The client must issue a "show stat\n" command in order
to get a CSV-formated output similar to the output on the HTTP socket
in CSV mode.

17 years ago[MEDIUM] implement the statistics output on a unix socket
Willy Tarreau [Wed, 17 Oct 2007 16:57:38 +0000 (18:57 +0200)] 
[MEDIUM] implement the statistics output on a unix socket

A unix socket can now access the statistics. It currently only
recognizes the "show stat\n" command at the beginning of the
input, then returns the statistics in CSV format.

17 years ago[MINOR] add a link to the CSV export on the stats page.
Willy Tarreau [Thu, 18 Oct 2007 09:05:48 +0000 (11:05 +0200)] 
[MINOR] add a link to the CSV export on the stats page.

17 years ago[MEDIUM] implement the CSV output for the statistics
Willy Tarreau [Wed, 17 Oct 2007 16:44:57 +0000 (18:44 +0200)] 
[MEDIUM] implement the CSV output for the statistics

It is now possible to get CSV ouput from the statistics by
simply appending ";csv" to the HTTP request sent to get the
stats. The fields keep the same ordering as in the HTML page,
and a field "pxname" has been prepended at the beginning of
the line.

17 years ago[MEDIUM] moved stats and buffer generic functions to new files
Willy Tarreau [Wed, 17 Oct 2007 15:06:05 +0000 (17:06 +0200)] 
[MEDIUM] moved stats and buffer generic functions to new files

Neither the primitives used to write data to a buffer, nor the stats
dump functions are HTTP-specific anymore. Move them to dedicated
files

17 years ago[MINOR] make it possible to set unix socket permissions
Willy Tarreau [Thu, 18 Oct 2007 10:45:54 +0000 (12:45 +0200)] 
[MINOR] make it possible to set unix socket permissions

Under most systems, it is possible to set permissions on unix
sockets. This has been added to the listeners and to unix
sockets.

17 years ago[MAJOR] implemented client-side support for PF_UNIX sockets
Willy Tarreau [Tue, 16 Oct 2007 15:34:28 +0000 (17:34 +0200)] 
[MAJOR] implemented client-side support for PF_UNIX sockets

A new file, proto_uxst.c, implements support of PF_UNIX sockets
of type SOCK_STREAM. It relies on generic stream_sock_read/write
and uses its own accept primitive which also tries to be generic.

Right now it only implements an echo service in sight of a general
support for start dumping via unix socket. The echo code is more
of a proof of concept than useful code.

17 years ago[MAJOR] added generic protocol support
Willy Tarreau [Tue, 16 Oct 2007 10:25:14 +0000 (12:25 +0200)] 
[MAJOR] added generic protocol support

A new generic protocol mechanism has been added. It provides
an easy method to implement new protocols with different
listeners (eg: unix sockets).

The listeners are automatically started at the right moment
and enabled after the possible fork().

17 years ago[BUG] remove condition for exit() under fork() failure
Willy Tarreau [Tue, 16 Oct 2007 05:44:56 +0000 (07:44 +0200)] 
[BUG] remove condition for exit() under fork() failure

This must come from a copy-paste typo: in the unlikely event that
fork() would fail, the parent process would only exit(1) if there
were old pids. That's non-sense.

17 years ago[BUG] fix wrong timeout computation in event_accept()
Willy Tarreau [Mon, 15 Oct 2007 18:36:37 +0000 (20:36 +0200)] 
[BUG] fix wrong timeout computation in event_accept()

In case the incoming socket is set for write and not for read (very
unlikely, except in HEALTH mode), the timeout may remain eternity due
to a copy-paste typo.

17 years ago[BUG] fix segfault on exit in new appsession code
Willy Tarreau [Mon, 15 Oct 2007 18:04:22 +0000 (20:04 +0200)] 
[BUG] fix segfault on exit in new appsession code

The new appsession code didn't like it when appsession_hash_destroy()
was called with an empty hash table. Simply add the check.

17 years ago[MEDIUM] fixed call to chroot() during startup
Willy Tarreau [Mon, 15 Oct 2007 16:57:08 +0000 (18:57 +0200)] 
[MEDIUM] fixed call to chroot() during startup

It wasn't very wise to chroot() early during the startup. Also,
the exit() was missing if the chroot() failed.

17 years ago[MEDIUM] moved the sockaddr pointer to the fdtab structure
Willy Tarreau [Tue, 9 Oct 2007 15:14:37 +0000 (17:14 +0200)] 
[MEDIUM] moved the sockaddr pointer to the fdtab structure

The stream_sock_* functions had to know about sessions just in
order to get the server's address for a connect() operation. This
is not desirable, particularly for non-IP protocols (eg: PF_UNIX).

Put a pointer to the peer's sockaddr_storage or sockaddr address
in the fdtab structure so that we never need to look further.

With this small change, the stream_sock.c file is now 100% protocol
independant.

17 years ago[MINOR] report haproxy's version by default on the stats page
Krzysztof Oledzki [Mon, 15 Oct 2007 08:05:11 +0000 (10:05 +0200)] 
[MINOR] report haproxy's version by default on the stats page

For people who manage many haproxies, it is sometimes convenient
to be informed of their version. This patch adds this, with the
option to disable this report by specifying "stats hide-version".

Also, the feature may be permanently disabled by setting the
STATS_VERSION_STRING to "" (empty string), or the format can
simply be adjusted.

17 years ago[DOC] document spread-checks
Willy Tarreau [Sun, 14 Oct 2007 21:09:26 +0000 (23:09 +0200)] 
[DOC] document spread-checks

17 years ago[MINOR] spread checks also when the server is OK.
Willy Tarreau [Sun, 14 Oct 2007 21:47:04 +0000 (23:47 +0200)] 
[MINOR] spread checks also when the server is OK.

Initial patch only managed to spread the checks when the checks
failed. The randomization code needs to be added also in the path
where the server is going fine.

17 years ago[MEDIUM] only consider slow checks when looking for the common interval
Willy Tarreau [Sun, 14 Oct 2007 21:05:39 +0000 (23:05 +0200)] 
[MEDIUM] only consider slow checks when looking for the common interval

When one server in one backend has a very low check interval, it imposes
its value as the minimal interval, causing all other servers to start
their checks close to each other, thus partially voiding the benefits of
the spread checks.

The solution consists in ignoring intervals lower than a given value
(SRV_CHK_INTER_THRES = 1000 ms) when computing the minimal interval,
and then assigning them a start date relative to their own interval
and not the global one.

With this change, the checks distribution clearly looks better.

17 years ago[MEDIUM] Spread health checks even more
Krzysztof Oledzki [Sun, 14 Oct 2007 21:40:01 +0000 (23:40 +0200)] 
[MEDIUM] Spread health checks even more

When one server appears at the same position in multiple backends, it
receives all the checks from all the backends exactly at the same time
because the health-checks are only spread within a backend but not
globally.

Attached patch implements per-server start delay in a different way.
Checks are now spread globally - not locally to one backend. It also makes
them start faster - IMHO there is no need to add a 'server->inter' when
calculating first execution. Calculation were moved from cfgparse.c to
checks.c. There is a new function start_checks() and now it is not called
when haproxy is started in MODE_CHECK.

With this patch it is also possible to set a global 'spread-checks'
parameter. It takes a percentage value (1..50, probably something near
5..10 is a good idea) so haproxy adds or removes that many percent to the
original interval after each check. My test shows that with 18 backends,
54 servers total and 10000ms/5% it takes about 45m to mix them completely.

I decided to use rand/srand pseudo-random number generator. I am aware it
is not recommend for a good randomness but a) we do not need a good random
generator here b) it is probably the most portable one.

17 years ago[MINOR] add the "nolinger" option to disable data lingering
Alexandre Cassen [Thu, 11 Oct 2007 18:48:58 +0000 (20:48 +0200)] 
[MINOR] add the "nolinger" option to disable data lingering

The following patch will give the ability to tweak socket linger mode.
You can use this option with "option nolinger" inside fronted or backend
configuration declaration.

This will help in environments where lots of FIN_WAIT sockets are
encountered.

17 years ago[MEDIUM] do not add a cache-control: header when on non-cacheable responses
Krzysztof Oledzki [Thu, 11 Oct 2007 16:56:27 +0000 (18:56 +0200)] 
[MEDIUM] do not add a cache-control: header when on non-cacheable responses

I noticed that haproxy, with "cookie (...) nocache" option, always adds
"Cache-control: private" at the end of a header list received from this
server:

Cache-Control: no-cache
(...)
Set-Cookie: SERVERID=s6; path=/
Cache-control: private

or:

Set-Cookie: ASPSESSIONIDCSRCTSSB=HCCBGGACGBHDHMMKIOILPHNG; path=/
Cache-control: private
Set-Cookie: SERVERID=s5; path=/
Cache-control: private

It may be just redundant (two "Cache-control: private"), but sometimes it
may be quite confused as we may end with two different, more and less
restricted directions (no-cache & private) and even quite conflicting
directions (eg. public & private):

So, I added and rearranged a code, so now haproxy adds a "Cache-control:
private" header only when there is no the same (private) or more
restrictive (no-cache) one. It was done in three steps:

1. Use check_response_for_cacheability to check if response is
not cacheable. I simply moved this call before http_header_add_tail2.

2. Use TX_CACHEABLE (not TX_CACHE_COOK - apache <= 1.3.26) to check if we
need to add a Cache-control header. If we add it, clear TX_CACHEABLE and
TX_CACHE_COOK.

3. Check cacheability not only with PR_O_CHK_CACHE but also with
PR_O_COOK_NOC, so:

-                           unlikely(t->be->options & PR_O_CHK_CACHE))
+                           (t->be->options & (PR_O_CHK_CACHE|PR_O_COOK_NOC)))
                                txn->flags |= TX_CACHEABLE | TX_CACHE_COOK;

I removed this unlikely since I believe that now it is not so unlikely.

The patch is definitely not perfect, proxy should probably also remove
"Cache-control: public". Unfortunately, I do not know the code good enough
to do in myself, yet. ;)

Anyway, I think that even now, it should be very useful.

17 years ago[MINOR] prevent the system from sending an RST when closing health-checks
Krzysztof Oledzki [Thu, 11 Oct 2007 16:41:08 +0000 (18:41 +0200)] 
[MINOR] prevent the system from sending an RST when closing health-checks

On Sat, 22 Sep 2007, Willy Tarreau wrote:
> On Sun, Sep 23, 2007 at 03:23:38AM +0200, Krzysztof Oledzki wrote:
> > I noticed that with httpchk, haproxy generates TCP RST at end of a check.
> > IMHO, it would be more polite to send FIN to a server, especially that
> > each TCP RST found by a tcpdump makes me concerned that something is
> > wrong, as it is hard to distinguish between a RST from a httpchk and from
> > a normal request, forwarded for a client.
>
> I have also noticed it very recently. In fact, it's never the
> application (here haproxy) which decides to send an RST, it's the
> system. It does so because the server returns data on a terminated
> socket. I guess it's because the health-check code does not read much
> of the response. In fact, we just need to read enough to process common
> responses. If people are dumb enough to check with something like "GET
> /image.iso", they should expect to get an RST after a few kbytes
> instead of reading the whole file!

Right, that was easy. Attached patch changed what you described. Now
haproxy finishes http checks with FIN.

17 years ago[BUG] fix double-free during clean exit
Krzysztof Oledzki [Thu, 11 Oct 2007 16:30:14 +0000 (18:30 +0200)] 
[BUG] fix double-free during clean exit

This patch fixes a nasty bug raported by both glibc and valgrind, which
leads into a problem that haproxy does not exit when a new instace
starts ap (-sf/-st).

==9299== Invalid free() / delete / delete[]
==9299==    at 0x401D095: free (in
/usr/lib/valgrind/x86-linux/vgpreload_memcheck.so)
==9299==    by 0x804A377: deinit (haproxy.c:721)
==9299==    by 0x804A883: main (haproxy.c:1014)
==9299==  Address 0x41859E0 is 0 bytes inside a block of size 21 free'd
==9299==    at 0x401D095: free (in
/usr/lib/valgrind/x86-linux/vgpreload_memcheck.so)
==9299==    by 0x804A84B: main (haproxy.c:985)
==9299==

6542  open("/dev/tty", O_RDWR|O_NONBLOCK|O_NOCTTY) = -1 ENOENT (No such file
or directory)
6542  writev(2, [{"*** glibc detected *** ", 23}, {"corrupted double-linked
list", 28}, {": 0x", 4}, {"6ff91878", 8}, {" ***\n", 5}], 5) = -1 EBADF (Bad
file descriptor)

I found this bug trying to find why, after one week with many restarts, I
finished with >100 haproxy process running. ;)

17 years ago[TESTS] added a file to check that "retries" works.
Willy Tarreau [Tue, 18 Sep 2007 17:52:58 +0000 (19:52 +0200)] 
[TESTS] added a file to check that "retries" works.

17 years ago[MAJOR] timeouts and retries could be ignored when switching backend
Willy Tarreau [Tue, 18 Sep 2007 16:36:05 +0000 (18:36 +0200)] 
[MAJOR] timeouts and retries could be ignored when switching backend

When switching from a frontend to a backend, the "retries" parameter
was not kept, resulting in the impossibility to reconnect after the
first connection failure. This problem was reported and analyzed by
Krzysztof Oledzki.

While fixing the code, it appeared that some of the backend's timeouts
were not updated in the session when using "use_backend" or "default_backend".
It seems this had no impact but just in case, it's better to set them as
they should have been.

17 years ago[DOC] added missing keywords from haproxy.vim
Willy Tarreau [Mon, 17 Sep 2007 09:30:23 +0000 (11:30 +0200)] 
[DOC] added missing keywords from haproxy.vim

Pawel Golaszewski from pld-linux sent an update for the syntax highlight
in haproxy.vim.

17 years ago[MINOR] fix the SIGHUP message not to alert on server-less proxies
Willy Tarreau [Mon, 17 Sep 2007 09:27:09 +0000 (11:27 +0200)] 
[MINOR] fix the SIGHUP message not to alert on server-less proxies

The SIGHUP message was designed long before it was possible to have no
server in a proxy. Remove the alert in case there's no server.

17 years ago[MEDIUM] pre-initialize timeouts to infinity, not zero
Willy Tarreau [Mon, 17 Sep 2007 09:12:40 +0000 (11:12 +0200)] 
[MEDIUM] pre-initialize timeouts to infinity, not zero

Since the timers have been changed, the timeouts for the default instance
have not been adjusted. This results in unspecified timeouts becoming zero
instead of infinite.

17 years ago[MINOR] set the log socket receive window to zero bytes
Willy Tarreau [Mon, 17 Sep 2007 08:56:13 +0000 (10:56 +0200)] 
[MINOR] set the log socket receive window to zero bytes

The syslog UDP socket may receive data, which is not cool because those
data accumulate in the system buffers up to the receive socket buffer size.
To prevent this, we set the receive window to zero and try to shutdown(SHUT_RD)
the socket.

17 years ago[MEDIUM] fix configuration sanity checks for TCP listeners
Willy Tarreau [Mon, 17 Sep 2007 08:17:23 +0000 (10:17 +0200)] 
[MEDIUM] fix configuration sanity checks for TCP listeners

A log chain of if/else prevented many sanity checks from being
performed on TCP listeners, resulting in dangerous configs being
accepted. Removed the offending 'else'.

17 years ago[DOC] fixed 2 typos in haproxy-en/fr
Willy Tarreau [Sun, 9 Sep 2007 21:49:18 +0000 (23:49 +0200)] 
[DOC] fixed 2 typos in haproxy-en/fr

-st was indicated instead of -sf, and the pidfile was wrong.

17 years ago[BUILD] centralize version and date into one file for each
Willy Tarreau [Sun, 9 Sep 2007 21:31:11 +0000 (23:31 +0200)] 
[BUILD] centralize version and date into one file for each

The version does not appear anymore in the Makefiles nor in
the include files. It was a nightmare to maintain. Now there
is a VERSION file which contains the major version, a VERDATE
file which contains the date for this version and a SUBVERS
file which may contain a sub-version.

A "make version" target has been added to all makefiles to
check the version. The GNU Makefile also has an update-version
target to update those files. This should never be used.

It is still possible to override those values by specifying
them in the equivalent make variables. By default, the GNU
makefile tries to detect a GIT repository and always uses the
version and date from the current repository. This can be
disabled by setting IGNOREGIT to a non-void value.

17 years ago[DOC] added a small man page
Willy Tarreau [Sun, 9 Sep 2007 20:40:07 +0000 (22:40 +0200)] 
[DOC] added a small man page

Arnaud Cornet has started a small man page based on some information
gathered from the docs. I've completed it a bit.

17 years ago[MAJOR] remove files distributed under an obscure license
Willy Tarreau [Sun, 9 Sep 2007 19:56:53 +0000 (21:56 +0200)] 
[MAJOR] remove files distributed under an obscure license

src/chtbl.c, src/hashpjw.c and src/list.c are distributed under
an obscure license. While Aleks and I believe that this license
is OK for haproxy, other people think it is not compatible with
the GPL.

Whether it is or not is not the problem. The fact that it rises
a doubt is sufficient for this problem to be addressed. Arnaud
Cornet rewrote the unclear parts with clean GPLv2 and LGPL code.
The hash algorithm has changed too and the code has been slightly
simplified in the process. A lot of care has been taken in order
to respect the original API as much as possible, including the
LGPL for the exportable parts.

The new code has not been thoroughly tested but it looks OK now.

17 years ago[TESTS] added a new hash algorithm
Willy Tarreau [Sun, 9 Sep 2007 19:13:47 +0000 (21:13 +0200)] 
[TESTS] added a new hash algorithm

added "wt_hash" which shows only 60 collisions in 575k values, which
sets it between hashword() and djbx33(). It's also between both in
terms of performance, but the most important part is that its variable
length rotation mechanism should make it really harder to predict and
attack than the other ones.

17 years ago[MAJOR] spec I/O: fix allocations of spec entries for an FD
Willy Tarreau [Fri, 31 Aug 2007 15:01:18 +0000 (17:01 +0200)] 
[MAJOR] spec I/O: fix allocations of spec entries for an FD

Under some circumstances, it was possible with speculative I/O to
reallocate multiple entries for the same FD if an fd_{set,clr,set}
or fd_{clr,set,clr} sequences were performed before a schedule.

Fix this by keeping a an allocation flag for each fd.

17 years ago[MEDIUM] stats page: added links for 'refresh' and 'hide down'
Willy Tarreau [Wed, 25 Jul 2007 12:43:32 +0000 (14:43 +0200)] 
[MEDIUM] stats page: added links for 'refresh' and 'hide down'

The stats page now supports an option to hide servers which are DOWN
and to enable/disable automatic refresh. It is also possible to ask
for an immediate refresh.

17 years ago[MEDIUM] ensure we never overflow in chunk_printf()
Willy Tarreau [Wed, 25 Jul 2007 12:38:45 +0000 (14:38 +0200)] 
[MEDIUM] ensure we never overflow in chunk_printf()

The result of the vsnprintf() called in chunk_printf() must be checked,
and should be added only if lower than the requested size. We simply
return zero if we cannot write the chunk.

17 years ago[TESTS] provide a test configuration file for stats and checks
Willy Tarreau [Wed, 25 Jul 2007 05:37:40 +0000 (07:37 +0200)] 
[TESTS] provide a test configuration file for stats and checks

A file with 1000 servers and a stats interface has been added.

17 years ago[MINOR] add support for "stats refresh <interval>"
Willy Tarreau [Wed, 25 Jul 2007 05:26:38 +0000 (07:26 +0200)] 
[MINOR] add support for "stats refresh <interval>"

Sometimes it may be desirable to automatically refresh the
stats page. Most browsers support the "Refresh:" header with
an interval in seconds. Specifying "stats refresh xxx" will
automatically add this header.

17 years ago[DOC] the "stats" keyword is not allowed in a pure frontend.
Willy Tarreau [Tue, 24 Jul 2007 21:43:37 +0000 (23:43 +0200)] 
[DOC] the "stats" keyword is not allowed in a pure frontend.

17 years ago[DOC] started a new configuration manual
Willy Tarreau [Sun, 15 Jul 2007 18:15:28 +0000 (20:15 +0200)] 
[DOC] started a new configuration manual

This new configuration manual intends to document every known keyword
of the configuration language. Right now, it enumerates them all and
describes how to use ACLs.

17 years ago[MINOR] fix backend's weight in the stats page.
Willy Tarreau [Tue, 24 Jul 2007 22:28:06 +0000 (00:28 +0200)] 
[MINOR] fix backend's weight in the stats page.

The GCD used when computing the servers' weights causes the total
weight of the backend to appear lower than expected because it is
divided by the GCD. Easy solution consists in recomputing the GCD
from the first server and apply it to the global weight.

17 years ago[MEDIUM] improve behaviour with large number of servers per proxy
Willy Tarreau [Tue, 24 Jul 2007 21:32:33 +0000 (23:32 +0200)] 
[MEDIUM] improve behaviour with large number of servers per proxy

When a very large number of servers is configured (thousands),
shutting down many of them at once could lead to large number
of calls to recalc_server_map() which already takes some time.
This would result in an O(N^3) computation time, leading to
noticeable pauses on slow embedded CPUs on test platforms.

Instead, mark the map as dirty and recalc it only when needed.

18 years ago[MEDIUM] fade out memory usage when stopping proxies
Willy Tarreau [Wed, 11 Jul 2007 08:42:35 +0000 (10:42 +0200)] 
[MEDIUM] fade out memory usage when stopping proxies

Now we try to free as many pools as possible when a proxy is stopping.
The reason is that we want to ease the process replacement when applying
a new configuration, without keeping too many unused memory allocated.

18 years ago[MEDIUM] Added easier support for Doug Lea's malloc (dlmalloc)
Willy Tarreau [Wed, 11 Jul 2007 07:19:31 +0000 (09:19 +0200)] 
[MEDIUM] Added easier support for Doug Lea's malloc (dlmalloc)

It's now as easy as passing "DLMALLOC_SRC=<path_to_dlmalloc.c>" to
build with support for dlmalloc. The dlmalloc source is not provided
with haproxy in order to ensure that people will use either the most
recent, or the most suited version for their platform. The minimal
mmap size is specified in DLMALLOC_THRES, which defaults to 4096. It
should be increased on platforms with larger pages (eg: 8 kB on some
64 bit systems).

18 years ago[RELEASE] Released version 1.3.12 with the following main changes : v1.3.12
Willy Tarreau [Sun, 17 Jun 2007 21:41:40 +0000 (23:41 +0200)] 
[RELEASE] Released version 1.3.12 with the following main changes :

    - acl: smarter integer comparison support in ACLs
    - acl: specify the direction during fetches
    - acl: provide the argument length for fetch functions
    - acl: provide a reference to the expr to fetch()
    - acl: implement matching on header values
    - acl: support maching on 'path' component
    - acl: permit to return any header when no name specified
    - errorfile: use a local file to feed error messages
    - negation in ACL conds was not cleared between terms
    - fix segfault at exit when using captures
    - improve memory freeing upon exit
    - acl: support '-i' to ignore case when matching
    - str2net() must not change the const char *
    - provide default ACLs
    - acl: distinguish between request and response headers
    - added the 'use_backend' keyword for full content-switching
    - acl: added the TRUE and FALSE ACLs.
    - shut warnings 'is*' macros from ctype.h on solaris

18 years ago[CLEANUP] shut warnings 'is*' macros from ctype.h on solaris
Willy Tarreau [Sun, 17 Jun 2007 19:51:38 +0000 (21:51 +0200)] 
[CLEANUP] shut warnings 'is*' macros from ctype.h on solaris

Solaris visibly uses an array for is*, which returns warnings
about the use of signed chars as indexes. Good opportunity to
put casts everywhere.

18 years ago[MEDIUM] acl: added the TRUE and FALSE ACLs.
Willy Tarreau [Sun, 17 Jun 2007 18:40:25 +0000 (20:40 +0200)] 
[MEDIUM] acl: added the TRUE and FALSE ACLs.

Those ACLs are sometimes useful for troubleshooting. Two ACL subjects
"always_true" and "always_false" have been added too. They return what
their subject says for every pattern. Also, acl_match_pst() has been
removed.

18 years ago[MAJOR] added the 'use_backend' keyword for full content-switching
Willy Tarreau [Sun, 17 Jun 2007 17:56:27 +0000 (19:56 +0200)] 
[MAJOR] added the 'use_backend' keyword for full content-switching

The new "use_backend" keyword permits full content switching by the
use of ACLs. Its usage is simple :

   use_backend <backend_name> {if|unless} <acl_cond>

18 years ago[MEDIUM] acl: distinguish between request and response headers
Willy Tarreau [Sun, 17 Jun 2007 14:58:38 +0000 (16:58 +0200)] 
[MEDIUM] acl: distinguish between request and response headers

hdr(x) will now still be used for request headers, and shdr(x) for
server headers (response).

18 years ago[MEDIUM] provide default ACLs
Willy Tarreau [Sun, 17 Jun 2007 09:54:31 +0000 (11:54 +0200)] 
[MEDIUM] provide default ACLs

The following ACLs are predefined :

  LOCALHOST      = src 127.0.0.1/8
  HTTP_1.0       = req_ver 1.0
  HTTP_1.1       = req_ver 1.1
  METH_CONNECT   = method CONNECT
  METH_GET       = method GET HEAD
  METH_HEAD      = method HEAD
  METH_OPTIONS   = method OPTIONS
  METH_POST      = method POST
  METH_TRACE     = method TRACE
  HTTP_URL_ABS   = url_reg ^[^/:]*://
  HTTP_URL_SLASH = url_beg /
  HTTP_URL_STAR  = url *
  HTTP_CONTENT   = hdr_val(content-length) gt 0

18 years ago[BUG] str2net() must not change the const char *
Willy Tarreau [Sun, 17 Jun 2007 09:42:08 +0000 (11:42 +0200)] 
[BUG] str2net() must not change the const char *

str2net needs to put \0 in a const char *. Use strdup() for that.

18 years ago[MEDIUM] acl: support '-i' to ignore case when matching
Willy Tarreau [Sun, 17 Jun 2007 06:20:33 +0000 (08:20 +0200)] 
[MEDIUM] acl: support '-i' to ignore case when matching

Implemented the "-i" option on ACLs to state that the matching
will have to be performed for all patterns ignoring case. The
usage is :

   acl <aclname> <aclsubject> -i pattern1 ...

If a pattern must begin with "-", either it must not be the first one,
or the "--" option should be specified first.

18 years ago[MINOR] improve memory freeing upon exit
Willy Tarreau [Sat, 16 Jun 2007 22:36:03 +0000 (00:36 +0200)] 
[MINOR] improve memory freeing upon exit

The deinit() function is specialized in memory area freeing.
There were a ton of information that were not released at the
exit time, which made valgrind complain. Now, most of the entries
are freed. However, it seems like regfree() does not completely
free a regex (12 bytes lost per regex).

18 years ago[BUG] fix segfault at exit when using captures
Willy Tarreau [Sat, 16 Jun 2007 21:19:53 +0000 (23:19 +0200)] 
[BUG] fix segfault at exit when using captures

since pools v2, the way pools were destroyed at exit is incorrect
because it ought to account for users of those pools before freeing
them. This test also ensures there is no double free.

18 years ago[BUG] negation in ACL conds was not cleared between terms
Willy Tarreau [Sat, 16 Jun 2007 17:35:18 +0000 (19:35 +0200)] 
[BUG] negation in ACL conds was not cleared between terms

The exclamation mark (!) in front of an ACL condition was propagated
to the whole line instead of being flushed after parsing an acl name.

18 years ago[MEDIUM] errorfile: use a local file to feed error messages
Willy Tarreau [Sun, 10 Jun 2007 22:29:26 +0000 (00:29 +0200)] 
[MEDIUM] errorfile: use a local file to feed error messages

It is now possible to read error messages from local files,
using the 'errorfile' keyword. Those files are read during
parsing, so there's no I/O involved. They make it possible
to return custom error messages with custom status and headers.

18 years ago[MINOR] acl: permit to return any header when no name specified
Willy Tarreau [Sun, 10 Jun 2007 19:42:55 +0000 (21:42 +0200)] 
[MINOR] acl: permit to return any header when no name specified

Having the ability to match on hdr_xxx in addition to hdr_xxx(yyy)
makes it possible to match any value or to count the headers easily.

18 years ago[MEDIUM] acl: support maching on 'path' component
Willy Tarreau [Sun, 10 Jun 2007 19:28:46 +0000 (21:28 +0200)] 
[MEDIUM] acl: support maching on 'path' component

'path', 'path_reg', 'path_beg', 'path_end', 'path_sub', 'path_dir'
and 'path_dom' have been implemented to process the path component
of the URI. It starts after the host part, and stops before the
question mark.

18 years ago[MEDIUM] acl: implement matching on header values
Willy Tarreau [Sun, 10 Jun 2007 17:45:56 +0000 (19:45 +0200)] 
[MEDIUM] acl: implement matching on header values

hdr(x), hdr_reg(x), hdr_beg(x), hdr_end(x), hdr_sub(x), hdr_dir(x),
hdr_dom(x), hdr_cnt(x) and hdr_val(x) have been implemented. They
apply to any of the possibly multiple values of header <x>.

Right now, hdr_val() is limited to integer matching, but it should
reasonably be upgraded to match long long ints.

18 years ago[MINOR] acl: provide a reference to the expr to fetch()
Willy Tarreau [Sun, 10 Jun 2007 09:47:14 +0000 (11:47 +0200)] 
[MINOR] acl: provide a reference to the expr to fetch()

The fetch() functions may need to access the full expr to get
their args. Turn the void *arg into a struct acl_expr *expr.

18 years ago[MINOR] acl: provide the argument length for fetch functions
Willy Tarreau [Sun, 10 Jun 2007 09:17:01 +0000 (11:17 +0200)] 
[MINOR] acl: provide the argument length for fetch functions

Some fetch() functions will require an argument (eg: header).
It's wise to provide the argument size to optimize string
comparisons.

18 years ago[MINOR] acl: specify the direction during fetches
Willy Tarreau [Sun, 10 Jun 2007 08:06:18 +0000 (10:06 +0200)] 
[MINOR] acl: specify the direction during fetches

Some fetches such as 'line' or 'hdr' need to know the direction of
the test (request or response). A new 'dir' parameter is now
propagated from the caller to achieve this.

18 years ago[MEDIUM] smarter integer comparison support in ACLs
Willy Tarreau [Sat, 9 Jun 2007 21:10:04 +0000 (23:10 +0200)] 
[MEDIUM] smarter integer comparison support in ACLs

ACLs now support operators such as 'eq', 'le', 'lt', 'ge' and 'gt'
in order to give more flexibility to the language. Because of this
change, the 'dst_limit' keyword changed to 'dst_conn' and now requires
either a range or a test such as 'dst_conn lt 1000' which is more
understandable.

18 years ago[RELEASE] Released version 1.3.11.4 with the following main changes : v1.3.11.4
Willy Tarreau [Sun, 3 Jun 2007 15:27:07 +0000 (17:27 +0200)] 
[RELEASE] Released version 1.3.11.4 with the following main changes :

    - do not re-arm read timeout in SHUTR state
    - optimize I/O by detecting system starvation
    - the epoll FD must not be shared between processes
    - limit the number of events returned by *poll*

18 years ago[MEDIUM] limit the number of events returned by *poll*
Willy Tarreau [Sun, 3 Jun 2007 15:16:49 +0000 (17:16 +0200)] 
[MEDIUM] limit the number of events returned by *poll*

By default, epoll/kqueue used to return as many events as possible.
This could sometimes cause huge latencies (latencies of up to 400 ms
have been observed with many thousands of fds at once). Limiting the
number of events returned also reduces the latency by avoiding too
many blind processing. The value is set to 200 by default and can be
changed in the global section using the tune.maxpollevents parameter.

18 years ago[BUG] the epoll FD must not be shared between processes
Willy Tarreau [Sun, 3 Jun 2007 14:40:44 +0000 (16:40 +0200)] 
[BUG] the epoll FD must not be shared between processes

Recreate the epoll file descriptor after a fork(). It will ensure
that all processes will not share their epoll_fd. Some side effects
were encountered because of this, such as epoll_wait() returning an
FD which was previously deleted, in multi-process mode.

18 years ago[MEDIUM] optimize I/O by detecting system starvation
Willy Tarreau [Sun, 3 Jun 2007 12:10:36 +0000 (14:10 +0200)] 
[MEDIUM] optimize I/O by detecting system starvation

Compare the results of recv/send with the parameter passed and
detect whether the system has no free buffer space for send()
or has no data anymore for recv(). This dramatically reduces
the number of syscalls (by about 23%).

18 years ago[BUG] do not re-arm read timeout after writing data
Willy Tarreau [Sun, 3 Jun 2007 13:59:52 +0000 (15:59 +0200)] 
[BUG] do not re-arm read timeout after writing data

A second occurrence of read-timeout rearming was present in stream_sock.c.
To fix the problem, it was necessary to put the shutdown information in
the buffer (already planned).