proxygen
|
#include <LoadShedConfiguration.h>
Classes | |
struct | AddressOnlyCompare |
struct | SysParams |
Public Types | |
typedef std::set< folly::SocketAddress, AddressOnlyCompare > | AddressSet |
typedef std::set< NetworkAddress > | NetworkSet |
Private Attributes | |
AddressSet | whitelistAddrs_ |
NetworkSet | whitelistNetworks_ |
uint64_t | maxConnections_ {0} |
uint64_t | maxActiveConnections_ {0} |
uint64_t | acceptPauseOnAcceptorQueueSize_ {0} |
uint64_t | acceptResumeOnAcceptorQueueSize_ {0} |
uint64_t | minFreeMem_ {0} |
double | maxMemUsage_ {1.0} |
double | maxCpuUsage_ {1.0} |
double | minCpuIdle_ {0.0} |
uint64_t | logicalCpuCoreQuorum_ {0} |
uint64_t | cpuUsageExceedWindowSize_ {0} |
double | maxTcpMemUsage_ {1.0} |
double | minFreeTcpMemPct_ {0.0} |
std::chrono::milliseconds | period_ |
bool | loadSheddingEnabled_ {true} |
Class that holds an LoadShed configuration for a service
Definition at line 33 of file LoadShedConfiguration.h.
typedef std::set<folly::SocketAddress, AddressOnlyCompare> wangle::LoadShedConfiguration::AddressSet |
Definition at line 45 of file LoadShedConfiguration.h.
Definition at line 46 of file LoadShedConfiguration.h.
|
default |
|
default |
void wangle::LoadShedConfiguration::addWhitelistAddr | ( | folly::StringPiece | input | ) |
Definition at line 26 of file LoadShedConfiguration.cpp.
References addr, folly::Range< Iter >::str(), whitelistAddrs_, and whitelistNetworks_.
Referenced by TEST().
void wangle::LoadShedConfiguration::checkIsSane | ( | const SysParams & | sysParams | ) | const |
Definition at line 51 of file LoadShedConfiguration.cpp.
References cpuUsageExceedWindowSize_, loadSheddingEnabled_, logicalCpuCoreQuorum_, maxActiveConnections_, maxConnections_, maxCpuUsage_, maxMemUsage_, maxTcpMemUsage_, minCpuIdle_, minFreeMem_, minFreeTcpMemPct_, wangle::LoadShedConfiguration::SysParams::numLogicalCpuCores, period_, and wangle::LoadShedConfiguration::SysParams::totalMemBytes.
|
inline |
Definition at line 93 of file LoadShedConfiguration.h.
References acceptPauseOnAcceptorQueueSize_.
Referenced by TEST().
|
inline |
Definition at line 105 of file LoadShedConfiguration.h.
References acceptResumeOnAcceptorQueueSize_.
Referenced by TEST().
|
inline |
Definition at line 167 of file LoadShedConfiguration.h.
References cpuUsageExceedWindowSize_.
Referenced by TEST().
|
inline |
Definition at line 210 of file LoadShedConfiguration.h.
References addr, isWhitelisted(), and loadSheddingEnabled_.
|
inline |
Definition at line 186 of file LoadShedConfiguration.h.
References period_.
Referenced by TEST().
|
inline |
Definition at line 156 of file LoadShedConfiguration.h.
References logicalCpuCoreQuorum_.
|
inline |
Definition at line 83 of file LoadShedConfiguration.h.
References maxActiveConnections_.
Referenced by TEST().
|
inline |
Definition at line 74 of file LoadShedConfiguration.h.
References maxConnections_.
Referenced by TEST().
|
inline |
Definition at line 131 of file LoadShedConfiguration.h.
References maxCpuUsage_.
Referenced by TEST().
|
inline |
Definition at line 119 of file LoadShedConfiguration.h.
References maxMemUsage_.
Referenced by TEST().
|
inline |
Definition at line 193 of file LoadShedConfiguration.h.
References maxTcpMemUsage_.
|
inline |
Definition at line 143 of file LoadShedConfiguration.h.
References minCpuIdle_.
Referenced by TEST().
|
inline |
Definition at line 179 of file LoadShedConfiguration.h.
References minFreeMem_.
Referenced by TEST().
|
inline |
Definition at line 202 of file LoadShedConfiguration.h.
References minFreeTcpMemPct_.
|
inline |
Definition at line 59 of file LoadShedConfiguration.h.
References whitelistAddrs_.
Referenced by TEST().
|
inline |
Definition at line 68 of file LoadShedConfiguration.h.
References whitelistNetworks_.
Referenced by TEST().
bool wangle::LoadShedConfiguration::isWhitelisted | ( | const folly::SocketAddress & | addr | ) | const |
Definition at line 39 of file LoadShedConfiguration.cpp.
References whitelistAddrs_, and whitelistNetworks_.
Referenced by getLoadSheddingEnabled(), and TEST().
|
inline |
Set/get the acceptor queue size which can be used to pause accepting new client connections.
Definition at line 89 of file LoadShedConfiguration.h.
References acceptPauseOnAcceptorQueueSize_.
Referenced by TEST().
|
inline |
Set/get the acceptor queue size which can be used to resume accepting new client connections if accepting is paused.
Definition at line 101 of file LoadShedConfiguration.h.
References acceptResumeOnAcceptorQueueSize_.
Referenced by TEST().
|
inline |
Set/get the CPU usage exceed window size
Definition at line 163 of file LoadShedConfiguration.h.
References cpuUsageExceedWindowSize_, and folly::size().
Referenced by TEST().
|
inline |
Definition at line 206 of file LoadShedConfiguration.h.
References loadSheddingEnabled_.
|
inline |
Definition at line 183 of file LoadShedConfiguration.h.
References period_.
Referenced by TEST().
|
inline |
Set/get the number of most utilized cpu cores to use when comparing against cpu limits; a value of 0 or a value that equals the total number of cores on the executing system implies that mean CPU should be used. This field exists to more meaningfully handle uneven load distributions that can occur if for example network card interrupt affinity is set such that only X of Y cores are utilized for network packet processing.
Definition at line 153 of file LoadShedConfiguration.h.
References logicalCpuCoreQuorum_.
|
inline |
Set/get the maximum number of active downstream connections across all VIPs.
Definition at line 80 of file LoadShedConfiguration.h.
References maxActiveConnections_.
Referenced by TEST().
|
inline |
Set/get the maximum number of downstream connections across all VIPs.
Definition at line 73 of file LoadShedConfiguration.h.
References maxConnections_.
Referenced by TEST().
|
inline |
Set/get the maximum cpu usage. Regarded as a soft limit; variable amount of new conn shedding should occur when above this limit.
Definition at line 126 of file LoadShedConfiguration.h.
References max, and maxCpuUsage_.
Referenced by TEST().
|
inline |
Set/get the maximum memory usage. Regarded as a soft limit; variable amount of new conn shedding should occur when above this limit.
Definition at line 114 of file LoadShedConfiguration.h.
References max, and maxMemUsage_.
Referenced by TEST().
|
inline |
Definition at line 188 of file LoadShedConfiguration.h.
References max, and maxTcpMemUsage_.
|
inline |
Set/get the minimum cpu idle. Regarded as a hard limit; every new conn should shed when above this limit when normalized.
Definition at line 138 of file LoadShedConfiguration.h.
References min, and minCpuIdle_.
Referenced by TEST().
|
inline |
Set/get the minium actual free memory on the system. Regarded as a hard limit; every new conn should shed when above this limit when normalized.
Definition at line 176 of file LoadShedConfiguration.h.
References min, and minFreeMem_.
Referenced by TEST().
|
inline |
Definition at line 197 of file LoadShedConfiguration.h.
References min, and minFreeTcpMemPct_.
|
inline |
Set/get the set of IPs that should be whitelisted through even when we're trying to shed load.
Definition at line 58 of file LoadShedConfiguration.h.
References whitelistAddrs_.
Referenced by TEST().
|
inline |
Set/get the set of networks that should be whitelisted through even when we're trying to shed load.
Definition at line 65 of file LoadShedConfiguration.h.
References whitelistNetworks_.
Referenced by TEST().
|
private |
Definition at line 236 of file LoadShedConfiguration.h.
Referenced by getAcceptPauseOnAcceptorQueueSize(), and setAcceptPauseOnAcceptorQueueSize().
|
private |
Definition at line 237 of file LoadShedConfiguration.h.
Referenced by getAcceptResumeOnAcceptorQueueSize(), and setAcceptResumeOnAcceptorQueueSize().
|
private |
Definition at line 243 of file LoadShedConfiguration.h.
Referenced by checkIsSane(), getCpuUsageExceedWindowSize(), and setCpuUsageExceedWindowSize().
|
private |
Definition at line 247 of file LoadShedConfiguration.h.
Referenced by checkIsSane(), getLoadSheddingEnabled(), and setLoadSheddingEnabled().
|
private |
Definition at line 242 of file LoadShedConfiguration.h.
Referenced by checkIsSane(), getLogicalCpuCoreQuorum(), and setLogicalCpuCoreQuorum().
|
private |
Definition at line 235 of file LoadShedConfiguration.h.
Referenced by checkIsSane(), getMaxActiveConnections(), and setMaxActiveConnections().
|
private |
Definition at line 234 of file LoadShedConfiguration.h.
Referenced by checkIsSane(), getMaxConnections(), and setMaxConnections().
|
private |
Definition at line 240 of file LoadShedConfiguration.h.
Referenced by checkIsSane(), getMaxCpuUsage(), and setMaxCpuUsage().
|
private |
Definition at line 239 of file LoadShedConfiguration.h.
Referenced by checkIsSane(), getMaxMemUsage(), and setMaxMemUsage().
|
private |
Definition at line 244 of file LoadShedConfiguration.h.
Referenced by checkIsSane(), getMaxTcpMemUsage(), and setMaxTcpMemUsage().
|
private |
Definition at line 241 of file LoadShedConfiguration.h.
Referenced by checkIsSane(), getMinCpuIdle(), and setMinCpuIdle().
|
private |
Definition at line 238 of file LoadShedConfiguration.h.
Referenced by checkIsSane(), getMinFreeMem(), and setMinFreeMem().
|
private |
Definition at line 245 of file LoadShedConfiguration.h.
Referenced by checkIsSane(), getMinFreeTcpMemPct(), and setMinFreeTcpMemPct().
|
private |
Definition at line 246 of file LoadShedConfiguration.h.
Referenced by checkIsSane(), getLoadUpdatePeriod(), and setLoadUpdatePeriod().
|
private |
Definition at line 232 of file LoadShedConfiguration.h.
Referenced by addWhitelistAddr(), getWhitelistAddrs(), isWhitelisted(), and setWhitelistAddrs().
|
private |
Definition at line 233 of file LoadShedConfiguration.h.
Referenced by addWhitelistAddr(), getWhitelistNetworks(), isWhitelisted(), and setWhitelistNetworks().