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 REORG/MAJOR: session: rename the "session" entity to "stream" 2015-04-06 11:23:56 +02:00
action.h MINOR: action: Add a function pointer in act_rule struct to check its validity 2017-10-31 11:36:12 +01:00
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 MAJOR: auth: Change the internal authentication system. 2014-03-17 18:06:06 +01:00
backend.h MINOR: backend: implement random-based load balancing 2018-05-03 07:20:40 +02:00
cache.h MEDIUM: cache: enable the HTTP analysers 2017-11-20 19:22:27 +01:00
capture.h CLEANUP: pools: rename all pool functions and pointers to remove this "2" 2017-11-24 17:49:53 +01:00
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 MEDIUM: cli: Add payload support 2018-04-26 14:19:33 +02:00
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 MINOR: http: Log warning if (add|set)-header fails 2018-05-28 14:53:59 +02:00
dns.h MINOR: dns: new DNS options to allow/prevent IP address duplication 2018-07-12 17:56:44 +02:00
fd.h MINOR: pollers: move polled_mask outside of struct fdtab. 2018-05-06 06:27:34 +02:00
filters.h MAJOR: chunks: replace struct chunk with struct buffer 2018-07-19 16:23:43 +02:00
freq_ctr.h [MINOR] freq_ctr: add new types and functions for periods different from 1s 2010-08-10 14:01:09 +02:00
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 [BUG] files were missing for hdr_idx in previous commit 2006-12-04 02:20:02 +01:00
hlua.h MEDIUM: lua: Add stick table support for Lua. 2018-09-29 20:15:01 +02:00
lb_chash.h MINOR: backend: add hash-balance-factor option for hash-type consistent 2016-10-25 20:21:32 +02:00
lb_fas.h MEDIUM: backend: add the 'first' balancing algorithm 2012-02-21 22:27:27 +01:00
lb_fwlc.h [MEDIUM] build: switch ebtree users to use new ebtree version 2009-10-26 21:10:04 +01:00
lb_fwrr.h [MEDIUM] build: switch ebtree users to use new ebtree version 2009-10-26 21:10:04 +01:00
lb_map.h MEDIUM: threads/lb: Make LB algorithms (lb_*.c) thread-safe 2017-10-31 13:58:31 +01:00
listener.h MEDIUM: ssl: add support for ciphersuites option for TLSv1.3 2018-10-08 19:20:13 +02:00
log.h MINOR: log: Keep the ref when a log server is copied to avoid duplicate entries 2018-04-05 15:13:54 +02:00
mailers.h MINOR: mailers: make it possible to configure the connection timeout 2016-02-20 15:33:06 +01:00
map.h CLEANUP: map: it seems that the map were planed to be chained 2016-03-30 15:41:15 +02:00
obj_type.h MINOR: connection: introduce conn_stream 2017-10-31 18:03:23 +01:00
pattern.h MINOR: threads: Use __decl_hathreads to declare locks 2017-11-13 11:38:17 +01:00
peers.h MINOR: threads: Use __decl_hathreads to declare locks 2017-11-13 11:38:17 +01:00
pipe.h [MEDIUM] introduce pipe pools 2009-01-25 13:49:53 +01:00
port_range.h [MEDIUM] add support for binding to source port ranges during connect 2009-06-10 12:23:32 +02:00
proto_http.h REORG: http: move HTTP rules parsing to http_rules.c 2018-10-02 18:28:05 +02:00
proto_udp.h MEDIUM: protocol: add minimalist UDP protocol client 2015-06-13 22:07:35 +02:00
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 MEDIUM: shctx: use unsigned int for len and block_count 2017-11-21 21:35:04 +01:00
signal.h [MEDIUM] signals: add support for registering functions and tasks 2010-08-27 18:00:40 +02:00
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 MINOR: http: Log warning if (add|set)-header fails 2018-05-28 14:53:59 +02:00
stick_table.h MINOR: stick-tables: Adds support for new "gpc1" and "gpc1_rate" counters. 2018-01-31 09:40:05 +01:00
stream.h MEDIUM: add set-priority-class and set-priority-offset 2018-08-10 15:06:31 +02:00
stream_interface.h MEDIUM: connections: Change struct wait_list to wait_event. 2018-10-11 15:34:39 +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 [CLEANUP] included common/version.h everywhere 2006-06-29 18:54:54 +02:00
vars.h MINOR: threads: Use __decl_hathreads to declare locks 2017-11-13 11:38:17 +01:00