#include <ChildConfig.h>
Public Types | |
enum | SubmissionErrorHandlingAction { actDie , actErr } |
how to handle a serious problem with a helper request submission More... | |
Public Member Functions | |
ChildConfig () | |
ChildConfig (const unsigned int m) | |
int | needNew () const |
void | parseConfig () |
ChildConfig & | updateLimits (const ChildConfig &rhs) |
Public Attributes | |
unsigned int | n_max |
unsigned int | n_startup |
unsigned int | n_idle |
unsigned int | concurrency |
unsigned int | n_running |
unsigned int | n_active |
unsigned int | queue_size |
SubmissionErrorHandlingAction | onPersistentOverload |
how to handle a new request for helper that was overloaded for too long More... | |
bool | defaultQueueSize |
time_t | reservationTimeout = 64 |
older stateful helper server reservations may be forgotten More... | |
Detailed Description
Contains statistics of a particular type of child helper.
Some derived from a helper children configuration option, some from runtime stats on the currently active children.
Definition at line 21 of file ChildConfig.h.
Member Enumeration Documentation
◆ SubmissionErrorHandlingAction
Enumerator | |
---|---|
actDie | kill the caller process (i.e., Squid worker) |
actErr | drop the request and send an error to the caller |
Definition at line 94 of file ChildConfig.h.
Constructor & Destructor Documentation
◆ ChildConfig() [1/2]
Helper::ChildConfig::ChildConfig | ( | ) |
Definition at line 19 of file ChildConfig.cc.
◆ ChildConfig() [2/2]
|
explicit |
Definition at line 31 of file ChildConfig.cc.
Member Function Documentation
◆ needNew()
int Helper::ChildConfig::needNew | ( | ) | const |
When new helpers are needed call this to find out how many more we are allowed to start.
- Return values
-
0 No more helpers may be started right now. N < 0 Error. No more helpers may be started. N N more helpers may be started immediately.
Definition at line 59 of file ChildConfig.cc.
References reconfiguring, and starting_up.
Referenced by Enqueue(), and StatefulEnqueue().
◆ parseConfig()
void Helper::ChildConfig::parseConfig | ( | ) |
Definition at line 72 of file ChildConfig.cc.
References action(), DBG_CRITICAL, DBG_IMPORTANT, DBG_PARSE_NOTE, debugs, ConfigParser::NextToken(), self_destruct(), and xatoui().
◆ updateLimits()
Helper::ChildConfig & Helper::ChildConfig::updateLimits | ( | const ChildConfig & | rhs | ) |
Update an existing set of details with new start/max/idle/concurrent limits. This is for parsing new child settings into an object incrementally then updating the running set without losing any of the active state or causing races.
Definition at line 44 of file ChildConfig.cc.
References concurrency, defaultQueueSize, n_idle, n_max, n_startup, onPersistentOverload, and queue_size.
Member Data Documentation
◆ concurrency
unsigned int Helper::ChildConfig::concurrency |
How many concurrent requests each child helper may be capable of handling. Default: 0 - no concurrency possible.
Definition at line 72 of file ChildConfig.h.
Referenced by Ssl::Config::Config(), GetFirstAvailable(), helperReturnBuffer(), parse_externalAclHelper(), parse_obsolete(), and updateLimits().
◆ defaultQueueSize
bool Helper::ChildConfig::defaultQueueSize |
True if the default queue size is used. Needed in the cases where we need to adjust default queue_size in special configurations, for example when redirector_bypass is used.
Definition at line 106 of file ChildConfig.h.
Referenced by parse_externalAclHelper(), redirectInit(), and updateLimits().
◆ n_active
unsigned int Helper::ChildConfig::n_active |
Count of helper children active (not shutting down). This includes both idle and in-use children.
Definition at line 86 of file ChildConfig.h.
Referenced by Enqueue(), helperShutdown(), helperStatefulShutdown(), and StatefulEnqueue().
◆ n_idle
unsigned int Helper::ChildConfig::n_idle |
Number of helper children to keep available as a buffer against sudden bursts of requests. set via the idle=N option. May be zero.
The default value for backward compatibility the default for this is the same as maximum children. For now the actual number of idle children is only reduced by a reconfigure operation. This may change.
Definition at line 66 of file ChildConfig.h.
Referenced by parse_externalAclHelper(), and updateLimits().
◆ n_max
unsigned int Helper::ChildConfig::n_max |
maximum child process limits. How many of this helper the system can cope with
Definition at line 48 of file ChildConfig.h.
Referenced by configDoConfigure(), Enqueue(), parse_externalAclHelper(), StatefulEnqueue(), and updateLimits().
◆ n_running
unsigned int Helper::ChildConfig::n_running |
Total helper children objects currently existing. Produced as a side effect of starting children or their stopping.
Definition at line 80 of file ChildConfig.h.
Referenced by GetFirstAvailable(), and StatefulGetFirstAvailable().
◆ n_startup
unsigned int Helper::ChildConfig::n_startup |
Number of children to kick off at startup. set via the startup=N option.
By default if undefined 1 will be started immediately for use. The minimum/idle amount will be scheduled for starting as soon as possible after startup is completed.
Definition at line 57 of file ChildConfig.h.
Referenced by parse_externalAclHelper(), and updateLimits().
◆ onPersistentOverload
SubmissionErrorHandlingAction Helper::ChildConfig::onPersistentOverload |
Definition at line 99 of file ChildConfig.h.
Referenced by updateLimits().
◆ queue_size
unsigned int Helper::ChildConfig::queue_size |
The requests queue size. By default it is of size 2*n_max
Definition at line 91 of file ChildConfig.h.
Referenced by Enqueue(), parse_externalAclHelper(), redirectInit(), StatefulEnqueue(), and updateLimits().
◆ reservationTimeout
time_t Helper::ChildConfig::reservationTimeout = 64 |
Definition at line 109 of file ChildConfig.h.
Referenced by StatefulGetFirstAvailable().
The documentation for this class was generated from the following files:
- src/helper/ChildConfig.h
- src/helper/ChildConfig.cc
- src/tests/stub_HelperChildConfig.cc