haproxy/include/types
Willy Tarreau ed72d82827 MEDIUM: time: measure the time stolen by other threads
The purpose is to detect if threads or processes are competing for the
same CPU. This can happen when threads are incorrectly bound, or after a
reload if the previous process still has an important activity. With
threads this situation is problematic because a preempted thread holding
a lock will block other ones waiting for this lock to be released.

A first attempt consisted in measuring the cumulated lost time more
precisely but the system's scheduler is smart enough to try to limit the
thread preemption rate by mostly context switching during poll()'s blank
periods, so most of the time lost is not seen. In essence this is good
because it means a thread is not preempted with a lock held, and even
regarding the rendez-vous point it cannot prevent the other ones from
making progress. But still it happens tens to hundreds of times per
second that a thread might be preempted, so it's still possible to detect
that the situation is happening, thus it's interesting to measure and
report its frequency.

Each time we enter the poller, we check the CPU time spent working and
see if we've lost time doing something else. To limit false positives,
we're only interested in losses of 500 microseconds or more (i.e. half
a clock tick on a 1 kHz system). If so, it indicates that some time was
stolen by another thread or process. Note that we purposely store some
sub-millisecond counters so that under heavy traffic with a 1 kHz clock,
it's still possible to measure something without being subject to the
risk of rounding errors (i.e. if exactly 1 ms is stolen it's possible
that the time difference could often be slightly lower).

This counter of lost CPU time slots time is reported in "show activity"
in numbers of milliseconds of CPU lost per second, per 15s, and total
over the process' life. By definition, the per-second counter cannot
report values larger than 1000 per thread per second and the 15s one
will be limited to 15000/s in the worst case, but it's possible that
peak values exceed such thresholds after long pauses.
2018-10-19 08:51:59 +02:00
..
acl.h
action.h
applet.h MINOR: snapshot: restart on the event ID and not the stream ID 2018-09-07 15:00:43 +02:00
arg.h MAJOR: chunks: replace struct chunk with struct buffer 2018-07-19 16:23:43 +02:00
auth.h
backend.h
cache.h
capture.h
channel.h MAJOR: buffer: finalize buffer detachment 2018-07-19 16:23:43 +02:00
checks.h MEDIUM: connections: Change struct wait_list to wait_event. 2018-10-11 15:34:39 +02:00
cli.h
compression.h MAJOR: buffer: finalize buffer detachment 2018-07-19 16:23:43 +02:00
connection.h DOC: Fix a few typos 2018-10-15 19:38:15 +02:00
counters.h
dns.h MINOR: dns: new DNS options to allow/prevent IP address duplication 2018-07-12 17:56:44 +02:00
fd.h
filters.h MAJOR: chunks: replace struct chunk with struct buffer 2018-07-19 16:23:43 +02:00
freq_ctr.h
global.h MEDIUM: time: measure the time stolen by other threads 2018-10-19 08:51:59 +02:00
h1.h MINOR: h1: Add the flag H1_MF_NO_PHDR to not add pseudo-headers during parsing 2018-10-12 16:15:18 +02:00
hdr_idx.h
hlua.h MEDIUM: lua: Add stick table support for Lua. 2018-09-29 20:15:01 +02:00
lb_chash.h
lb_fas.h
lb_fwlc.h
lb_fwrr.h
lb_map.h
listener.h MEDIUM: ssl: add support for ciphersuites option for TLSv1.3 2018-10-08 19:20:13 +02:00
log.h
mailers.h
map.h
obj_type.h
pattern.h
peers.h
pipe.h
port_range.h
proto_http.h REORG: http: move HTTP rules parsing to http_rules.c 2018-10-02 18:28:05 +02:00
proto_udp.h
protocol.h MEDIUM: protocol: use a custom AF_MAX to help protocol parser 2018-09-12 07:12:27 +02:00
proxy.h MINOR: http: Use same flag for httpclose and forceclose options 2018-10-12 16:07:56 +02:00
queue.h MINOR: queue: replace the linked list with a tree 2018-08-10 15:06:27 +02:00
sample.h REORG: http: move the HTTP semantics definitions to http.h/http.c 2018-09-11 10:30:25 +02:00
server.h MEDIUM: ssl: add support for ciphersuites option for TLSv1.3 2018-10-08 19:20:13 +02:00
session.h BUG/MEDIUM: session: fix reporting of handshake processing time in the logs 2018-09-05 16:30:23 +02:00
shctx.h
signal.h
spoe.h MAJOR: buffer: finalize buffer detachment 2018-07-19 16:23:43 +02:00
ssl_sock.h BUG/MINOR: ssl: properly ref-count the tls_keys entries 2018-07-18 08:59:50 +02:00
stats.h
stick_table.h
stream_interface.h MEDIUM: connections: Change struct wait_list to wait_event. 2018-10-11 15:34:39 +02:00
stream.h MEDIUM: add set-priority-class and set-priority-offset 2018-08-10 15:06:31 +02:00
task.h MINOR: tasks: Add a flag that tells if we're in the global runqueue. 2018-07-26 16:33:10 +02:00
template.h
vars.h