haproxy/include/common
Willy Tarreau eab777c32e BUG/MINOR: time: frequency counters are not totally accurate
When a frontend is rate-limited to 1000 connections per second, the
effective rate measured from the client is 999/s, and connections
experience an average response time of 99.5 ms with a standard
deviation of 2 ms.

The reason for this inaccuracy is that when computing frequency
counters, we use one part of the previous value proportional to the
number of milliseconds remaining in the current second. But even the
last millisecond still uses a part of the past value, which is wrong :
since we have a 1ms resolution, the last millisecond must be dedicated
only to filling the current second.

So we slightly adjust the algorithm to use 999/1000 of the past value
during the first millisecond, and 0/1000 of the past value during the
last millisecond.  We also slightly improve the computation by computing
the remaining time instead of the current time in tv_update_date(), so
that we don't have to negate the value in each frequency counter.

Now with the fix, the connection rate measured by both the client and
haproxy is a steady 1000/s, the average response time measured is 99.2ms
and more importantly, the standard deviation has been divided by 3 to
0.6 millisecond.

This fix should also be backported to 1.4 which has the same issue.
2012-12-29 21:50:07 +01:00
..
accept4.h BUILD: accept4: move the socketcall declaration outside of accept4() 2012-10-10 17:42:39 +02:00
appsession.h [MINOR] Make appsess{,ion}_refresh static 2011-06-25 21:07:01 +02:00
base64.h
buffer.h MAJOR: channel: replace the struct buffer with a pointer to a buffer 2012-10-13 09:07:52 +02:00
cfgparse.h MINOR: config: make str2listener() use memprintf() to report errors. 2012-09-24 10:53:16 +02:00
chunk.h MINOR: chunks: centralize the trash chunk allocation 2012-12-23 21:46:07 +01:00
compat.h MINOR: IPv6 support for transparent proxy 2012-07-31 07:53:42 +02:00
compiler.h CLEANUP: ebtree: clarify licence and update to 6.0.6 2011-12-02 17:09:49 +01:00
config.h
debug.h
defaults.h MINOR: build: allow packagers to specify the ssl cache size 2012-11-15 10:52:19 +01:00
epoll.h MAJOR: polling: replace epoll with sepoll and remove sepoll 2012-11-11 20:53:30 +01:00
errors.h
memory.h MEDIUM: memory: add the ability to poison memory at run time 2012-05-08 21:28:16 +02:00
mini-clist.h
rbtree.h
regex.h
sessionhash.h
splice.h [REORG] build: move syscall redefinition to specific places 2011-08-23 00:11:25 +02:00
standard.h MINOR: tools: simplify the use of the int to ascii macros 2012-12-23 21:46:30 +01:00
syscall.h MEDIUM: listener: add support for linux's accept4() syscall 2012-10-08 20:11:03 +02:00
template.h
ticks.h
time.h BUG/MINOR: time: frequency counters are not totally accurate 2012-12-29 21:50:07 +01:00
tools.h [MINOR] tools: add two macros MID_RANGE and MAX_RANGE 2011-03-28 15:55:43 +02:00
uri_auth.h [REORG] http: move the http-request rules to proto_http 2011-03-13 22:00:24 +01:00
version.h