#include <ChildConfig.h>

Collaboration diagram for Helper::ChildConfig:

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 ()
 
ChildConfigupdateLimits (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
 

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

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

Helper::ChildConfig::ChildConfig ( )

Definition at line 19 of file ChildConfig.cc.

Helper::ChildConfig::ChildConfig ( const unsigned int  m)
explicit

Definition at line 31 of file ChildConfig.cc.

Member Function Documentation

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
0No more helpers may be started right now.
N< 0 Error. No more helpers may be started.
NN more helpers may be started immediately.

Definition at line 59 of file ChildConfig.cc.

References reconfiguring, and starting_up.

Referenced by Enqueue(), helperOpenServers(), helperServerFree(), helperStatefulOpenServers(), helperStatefulServerFree(), StatefulEnqueue(), and helper::willOverload().

void Helper::ChildConfig::parseConfig ( )
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 loosing 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.

Referenced by redirectInit().

Member Data Documentation

unsigned int Helper::ChildConfig::concurrency
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().

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(), helperOpenServers(), helperServerFree(), helperShutdown(), helperStatefulOpenServers(), helperStatefulServerFree(), helperStatefulShutdown(), helper::packStatsInto(), and StatefulEnqueue().

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 dump_externalAclHelper(), parse_externalAclHelper(), and updateLimits().

unsigned int Helper::ChildConfig::n_max
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(), helperOpenServers(), helperServerFree(), helperStatefulOpenServers(), helperStatefulServerFree(), helper::packStatsInto(), and StatefulGetFirstAvailable().

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 dump_externalAclHelper(), helperServerFree(), helperStatefulServerFree(), parse_externalAclHelper(), and updateLimits().

SubmissionErrorHandlingAction Helper::ChildConfig::onPersistentOverload

Definition at line 99 of file ChildConfig.h.

Referenced by helper::prepSubmit(), and updateLimits().

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(), helper::overloaded(), parse_externalAclHelper(), helper::queueFull(), redirectInit(), StatefulEnqueue(), and updateLimits().


The documentation for this class was generated from the following files:

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors