Commit Graph

70 Commits

Author SHA1 Message Date
Willy Tarreau
a7e76142a1 [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.
2007-11-03 14:28:39 +01:00
Willy Tarreau
0173280bfa [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.
2007-11-01 23:05:09 +01:00
Willy Tarreau
23085b6df8 [TESTS] add a simple test for the status page 2007-10-25 20:17:40 +02:00
Willy Tarreau
fe94460d53 [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.
2007-10-25 10:34:16 +02:00
Willy Tarreau
d1eb3f0919 [TESTS] added a file to check that "retries" works. 2007-10-15 09:32:21 +02:00
Willy Tarreau
51041c737c [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.
2007-09-09 21:56:53 +02:00
Willy Tarreau
ab28b8b9fd [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.
2007-09-09 21:13:47 +02:00
Willy Tarreau
ca769dc631 [TESTS] provide a test configuration file for stats and checks
A file with 1000 servers and a stats interface has been added.
2007-09-09 21:09:28 +02:00
Willy Tarreau
ab3e1d313c [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%).
2007-06-03 16:05:39 +02:00
Willy Tarreau
ae5f7dadef [TESTS] updates to hash experimentations
Aleksandar Lazic has collected many hashing algorithms and put them
in one file to ease benchmarking. Some algos look promising, some
of them have been checked further with uri_hash. Some results on
various systems/hardware are stored in hash_results.txt.
2007-05-13 11:40:04 +02:00
Willy Tarreau
119680bc5e [TESTS] test_pools: added support for dlmalloc() 2007-05-12 16:14:55 +02:00
Willy Tarreau
ad99d29a00 [TESTS] added test_pools from Aleksandar Lazic
This simple test performs memory allocations using pools and
mallocs and returns the average number of allocations per second.
2007-05-12 15:51:02 +02:00
Willy Tarreau
58ef70227a [TESTS] added a trivial program to benchmark hash algos
The uri_hash.c program makes it very easy to benchmark the
distribution of hash algos. Pass it one word per line, and
it will show the distribution per server for 1 to 10 servers.
2007-05-08 23:22:43 +02:00
Willy Tarreau
1da7a77031 [TESTS] added two new test configurations
- one for basic features
- one for httpterm
2006-07-29 16:47:12 +02:00
willy tarreau
1a3442daee * added the 'source' load-balancing algorithm which uses the source IP(v4|v6) 2006-03-25 20:33:17 +01:00
willy tarreau
b8d29e4361 * some regression test files for active/backup conditions. 2006-03-25 20:33:14 +01:00
willy tarreau
9970d5cf80 * fixed odd addresses in tests/defaults.cfg 2006-01-08 01:51:58 +01:00
willy tarreau
eedaa9f220 * released 1.1.23
* fixed a stupid bug introduced in 1.1.22 which caused second and subsequent
  'default' sections to keep previous parameters, and not initialize logs
  correctly.
* fixed a second stupid bug introduced in 1.1.22 which caused configurations
  relying on 'dispatch' mode to segfault at the first connection.
* 'option httpchk' now supports method, HTTP version and a few headers.
* now, 'option httpchk', 'cookie' and 'capture' can be specified in
  'defaults' section
* a fresh new english documentation
* large Makefile cleanup for increased portability
* new build script 'build.cfg' for Formilux-0.1.8
* new startup script 'init.haproxy.flx0' for Formilux-0.1.8
2005-12-17 14:08:03 +01:00
willy tarreau
a41a8b4ee6 * released 1.1.22
* 'listen' now supports optionnal address:port-range lists
* 'bind' introduced to add new listen addresses
* fixed a bug which caused a session to be kept established on a server till
  it timed out if the client closed during the DATA phase.
* the port part of each server address can now be empty to make the proxy
  connect to the server on the same port it was connected to, be an absolute
  unsigned number to reflect a single port (as in older versions), or an
  explicitly signed number (+N/-N) to indicate that this offset must be
  applied to the port the proxy was connected to, when connecting to the
  server.
* the 'port' server option allows the user to specify a different
  health-check port than the service one. It is mandatory when only relative
  ports have been specified and check is required. By default, the checks are
  sent to the service port.
* new 'defaults' section which is rather similar to 'listen' except that all
  values are only used as default values for future 'listen' sections, until
  a new 'defaults' resets them. At the moment, server options, regexes,
  cookie names and captures cannot be set in the 'defaults' section.
* Makefile now optimizes for Ultrasparc by default on Solaris/Sparc
* large documentation updates and fixes
* new 'tests' directory with some debug files
2005-12-17 14:02:24 +01:00
willy tarreau
0f7af91265 * initial commit of version 1.0.0 2005-12-17 12:21:26 +01:00