]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/HelperChildConfig.h
1 #ifndef _SQUID_SRC_HELPERCHILDCONFIG_H
2 #define _SQUID_SRC_HELPERCHILDCONFIG_H
5 * Contains statistics of a particular type of child helper.
7 * Some derived from a helper children configuration option,
8 * some from runtime stats on the currently active children.
10 class HelperChildConfig
13 explicit HelperChildConfig(const unsigned int m
= 0);
16 * When new helpers are needed call this to find out how many more
17 * we are allowed to start.
18 * \retval 0 No more helpers may be started right now.
19 * \retval N < 0 Error. No more helpers may be started.
20 * \retval N N more helpers may be started immediately.
26 * Update an existing set of details with new start/max/idle/concurrent limits.
27 * This is for parsing new child settings into an object incrementally then updating
28 * the running set without loosing any of the active state or causing races.
30 HelperChildConfig
&updateLimits(const HelperChildConfig
&rhs
);
32 /* values from squid.conf */
35 /** maximum child process limits. How many of this helper the system can cope with */
39 * Number of children to kick off at startup.
40 * set via the startup=N option.
42 * By default if undefined 1 will be started immediately for use.
43 * The minimum/idle amount will be scheduled for starting as soon as possible after startup is completed.
45 unsigned int n_startup
;
48 * Number of helper children to keep available as a buffer against sudden bursts of requests.
49 * set via the idle=N option. May be zero.
51 * The default value for backward compatibility the default for this is the same as maximum children.
52 * For now the actual number of idle children is only reduced by a reconfigure operation. This may change.
57 * How many concurrent requests each child helper may be capable of handling.
58 * Default: 0 - no concurrency possible.
60 unsigned int concurrency
;
62 /* derived from active operations */
65 * Total helper children objects currently existing.
66 * Produced as a side effect of starting children or their stopping.
68 unsigned int n_running
;
71 * Count of helper children active (not shutting down).
72 * This includes both idle and in-use children.
74 unsigned int n_active
;
77 /* Legacy parser interface */
78 #define parse_HelperChildConfig(c) (c)->parseConfig()
79 #define dump_HelperChildConfig(e,n,c) storeAppendPrintf((e), "\n%s %d startup=%d idle=%d concurrency=%d\n", (n), (c).n_max, (c).n_startup, (c).n_idle, (c).concurrency)
80 #define free_HelperChildConfig(dummy) // NO.
82 #endif /* _SQUID_SRC_HELPERCHILDCONFIG_H */