]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/helper/ChildConfig.h
2 * Copyright (C) 1996-2014 The Squid Software Foundation and contributors
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
9 #ifndef _SQUID_SRC_HELPER_CHILDCONFIG_H
10 #define _SQUID_SRC_HELPER_CHILDCONFIG_H
16 * Contains statistics of a particular type of child helper.
18 * Some derived from a helper children configuration option,
19 * some from runtime stats on the currently active children.
24 explicit ChildConfig(const unsigned int m
= 0);
27 * When new helpers are needed call this to find out how many more
28 * we are allowed to start.
29 * \retval 0 No more helpers may be started right now.
30 * \retval N < 0 Error. No more helpers may be started.
31 * \retval N N more helpers may be started immediately.
37 * Update an existing set of details with new start/max/idle/concurrent limits.
38 * This is for parsing new child settings into an object incrementally then updating
39 * the running set without loosing any of the active state or causing races.
41 ChildConfig
&updateLimits(const ChildConfig
&rhs
);
43 /* values from squid.conf */
46 /** maximum child process limits. How many of this helper the system can cope with */
50 * Number of children to kick off at startup.
51 * set via the startup=N option.
53 * By default if undefined 1 will be started immediately for use.
54 * The minimum/idle amount will be scheduled for starting as soon as possible after startup is completed.
56 unsigned int n_startup
;
59 * Number of helper children to keep available as a buffer against sudden bursts of requests.
60 * set via the idle=N option. May be zero.
62 * The default value for backward compatibility the default for this is the same as maximum children.
63 * For now the actual number of idle children is only reduced by a reconfigure operation. This may change.
68 * How many concurrent requests each child helper may be capable of handling.
69 * Default: 0 - no concurrency possible.
71 unsigned int concurrency
;
73 /* derived from active operations */
76 * Total helper children objects currently existing.
77 * Produced as a side effect of starting children or their stopping.
79 unsigned int n_running
;
82 * Count of helper children active (not shutting down).
83 * This includes both idle and in-use children.
85 unsigned int n_active
;
90 /* Legacy parser interface */
91 #define parse_HelperChildConfig(c) (c)->parseConfig()
92 #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)
93 #define free_HelperChildConfig(dummy) // NO.
95 #endif /* _SQUID_SRC_HELPER_CHILDCONFIG_H */