Removed one missed debugging write(), fixed buffer management.
Now the HTML table output uses a color code with a caption. Some
more statistics have been collected such as maximum values reached
and failed health checks. Null limits now show "-" instead of "0".
Right now it only validates the user/passwd according to a specified list,
and lets the user pass through the proxy if the authentication is OK, and
it refuses any invalid access with a 401 Unauthorized response.
- an uninitialized field in the struct session could cause a crash when
the session was freed. This has been encountered on Solaris only.
- Solaris and OpenBSD no not support shutdown() on listening socket. Let's
be nice to them by performing a soft stop if pause fails.
At least OpenBSD and Solaris do not support shutdown() on listening socket.
So instead of blocking the hot reconfiguration, at least we can perform a
soft stop if the shutdown fails, so that the new daemon can bind to the
ports without trouble.
Summary of changes :
- 'maxconn' server parameter to do per-server session limitation
- queueing to support non-blocking session limitation
- fixed removal of cookies for cookie-less servers such as backup servers
- two separate wait queues for expirable and non-expirable tasks provide
better performance with lots of sessions.
- some code cleanups and performance improvements
- made state dumps a bit more verbose
- fixed missing checks for NULL srv in dispatch mode
- load balancing on backup servers was not possible in source hash mode.
- two session flags shared the same bit, but fortunately they were not
compatible.
If a task was queued on a server and if this task was alone and aborted
before any other task did anything, there were situations by which it
might have queued itself in the run queue, then exited, and the upcoming
tv_queue() associated to the run loop would have resurrected it siently,
causing crashes in task_queue.
The new principle consists in assigning a task to every server that
needs a connection limit. This task will be woken up every time we
suspect we might leave some place to queue a task. The server's task
itself will only have to run across its queue and run the available
number of tasks.
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.
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.
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.
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.