willy tarreau [Tue, 9 May 2006 21:32:26 +0000 (23:32 +0200)]
[MINOR] set the expiration date when removing a cookie
It was specified in the documentation that a cookie would be deleted if the
client was switched to a cookie-less server such as a backup server, in
order to avoid stickyness on errors. To achieve this, an empty cookie was
returned. It seems this no longer works (at least with Firefox 1.5 and
Mozilla 1.8a5), because the browser returns the empty cookie. The cookie
specification says that in order to remove a cookie, it must be accompanied
by an expiration date in the past, so this is what we do. Tested on Mozilla
1.8a5, works.
willy tarreau [Mon, 8 May 2006 09:52:55 +0000 (11:52 +0200)]
[MINOR] swapped the queued and active sessions in the logs
It was not natural to read sess/pend/lsess/psess in the logs, so before
the feature became official, I've swapped them to read :
pend/sess/lsess/psess
Where <pend> is the overall number of pending connections on this instance,
including all the servers queues, <sess> is the number of sessions remaining
active on the server when the log was emitted (after the end of the session,
or after parsing the request), <lsess> and <psess> are the number of active
sessions on the listener and on the process respectively.
willy tarreau [Thu, 4 May 2006 17:23:38 +0000 (19:23 +0200)]
[MINOR] uninlining 6 very common functions saved 15% code size and improved perf
by about 1-2% :
tv_delayfrom, tv_cmp_ms, tv_cmp2, tv_cmp2_ms, tv_remain2, fd_delete
willy tarreau [Tue, 2 May 2006 20:54:52 +0000 (22:54 +0200)]
[MEDIUM] logs now show the time spent in the queue and the number of sessions
already waiting at accept() time. This number of session is global per instance
so it does not reflect one particular server.
willy tarreau [Tue, 2 May 2006 12:51:00 +0000 (14:51 +0200)]
[MEDIUM] slightly optimize the scheduler for non-expirable tasks.
The non-expirable tasks are now sent to a dedicated wait-queue so that
they do not pollute the other ones anymore. This is a temporary dirty
hack which will go away with the new O(log(n)) scheduler.
willy tarreau [Mon, 1 May 2006 22:19:57 +0000 (00:19 +0200)]
[MAJOR] first limited implementation of connection queueing.
There is no timeout yet, and the server UP/DOWN events are not used
to export/import list of connections yet. It seems that the process
can sometimes eat lots of user CPU (~50%) if a maxconn is set on an
overloaded server.
[MINOR] stupid bug which caused two different session flags to use the same bit.
Fortunately, this had no side effect because they were not used in same areas.
[MEDIUM] now the round-robin load balancer uses two passes to avoid saturated servers. The first avoids servers which have filled with maxconn connections, and a second pass can enforce the selection of one of them if the first pass found no candidate.
[MEDIUM] added the necessary infrastructure to support per-server session limits : - the "maxconn" config option - the new SV_STCPEND state (connection pending) - a per-server pending connections queue
* added the 'weight' parameter to the servers, limited to 1..256.
It is factored between all the servers so that the servers map
will be smaller and easier to construct.
* added the 'weight' parameter to the servers, limited to 1..256.
It is factored between all the servers so that the servers map
will be smaller and easier to construct.
willy tarreau [Sat, 25 Mar 2006 17:53:50 +0000 (18:53 +0100)]
* added the -sf/-st command-line arguments which are used to specify
a list of pids to send a FINISH or TERMINATE signal upon startup.
They will also be asked to release their port if a bind fails.
willy tarreau [Sat, 25 Mar 2006 17:17:56 +0000 (18:17 +0100)]
* reworked the startup mechanism to allow the sending of a signal to a list
of old pids if a socket cannot be bound, with a retry for a limited amount
of time (1 second by default).
willy tarreau [Sun, 19 Mar 2006 18:36:48 +0000 (19:36 +0100)]
Limit the number of consecutive accept() in multi-process mode.
This produces a more evenly distributed load across the processes and slightly
improves performance by reducing bottlenecks.
Willy TARREAU [Wed, 1 Mar 2006 21:44:17 +0000 (22:44 +0100)]
* health checks sent to servers configured with identical intervals
were sent in perfect synchronisation because the initial time was
the same for all. This could induce high load peaks when fragile
servers were hosting tens of instances for the same application.
Now the load is spread evenly across the smallest interval amongst
a listener.
Willy TARREAU [Wed, 1 Mar 2006 21:40:50 +0000 (22:40 +0100)]
* the default 'httpclose' option only sets the 'Connection:' headers
to 'close', but does not actually close any connection. The problem
is, there are some servers which don't close the connection even if
the proxy tells them 'Connection: close'. A workaround was added by
the way of a new option 'forceclose' (which implies 'httpclose'),
and which makes the proxy close the outgoing channel to the server
once it has sent all its headers. Just don't use this with the
'CONNECT' method of course !
Willy TARREAU [Wed, 1 Mar 2006 21:37:57 +0000 (22:37 +0100)]
* there was a bug in the way the backup servers were handled. They
were erroneously load-balanced while the doc said the opposite.
Since load-balanced backup servers is one of the features some
people have been asking for, the problem was fixed to reflect the
documented behaviour and a new option 'allbackups' was introduced
to provide the feature to those who need it.
Willy TARREAU [Wed, 1 Mar 2006 21:33:49 +0000 (22:33 +0100)]
* a never ending connect() could lead to a fast select() loop if
its timeout times the number of retransmits exceeded the server
read or write timeout, because the later was used to compute
select()'s timeout while the connection timeout was not reached.
Willy TARREAU [Wed, 1 Mar 2006 21:30:20 +0000 (22:30 +0100)]
* fixed some tv_cmp_ms() computations. Strictly speaking, there was
a very short window of 1 microsecond every millisecond during which
two events were not considered as 1 ms apart from each other.
Willy TARREAU [Wed, 1 Mar 2006 21:27:48 +0000 (22:27 +0100)]
* now we initialize the libc's localtime structures very early so
that even under OOM conditions, we can still send dated error
messages without segfaulting.
Willy TARREAU [Sun, 8 Jan 2006 00:24:12 +0000 (01:24 +0100)]
* fixed a nasty bug in epoll_loop() and poll_loop() by which an EPOLL_HUP event
could trigger both a read and a write calls, thus sometimes inducing headers
being directly sent from srv to cli without modification, and leading further
modification to crash the process by memory corruption, because
rep.data+rep.l<rep.h so the memmove() length argument is negative. Only
observed with epoll() and never poll(), though this one should have been
affected too. Now, only call functions which have been allowed to.