#include <Incoming.h>
Public Member Functions | |
void | init (int n) |
bool | startPolling (int n) |
void | finishPolling (int, SquidConfig::CommIncoming::Measure &) |
bool | check () |
Public Attributes | |
int | interval = (16 << Factor) |
StatHist | history |
Static Public Attributes | |
static const int | Factor = INCOMING_FACTOR |
static const int | MaxInterval = (256 << Factor) |
Private Attributes | |
int | ioEvents = 0 |
int | nMaximum = 0 |
Detailed Description
Automatic tuning for incoming requests.
INCOMING sockets are the listening ports for transport protocols. We need to check these fairly regularly, but how often? When the load increases, we want to check the incoming sockets more often. If we have a lot of one protocol incoming, then we need to check those sockets more than others.
Every time we check incoming sockets, we count how many new messages or connections were processed. This is used to adjust the interval for the next iteration.
- Returns
- whether it is time to check incoming sockets.
Finalize and update records when incoming sockets polled.
The new interval is calculated as the current interval, plus what we would like to see as an average number of events, minus the number of events just processed.
Caveats:
The higher the INCOMING_FACTOR, the slower the algorithm will respond to load spikes/increases/decreases in demand. A value between 3 and 8 is recommended.
Magic upper limit on interval. At the largest value the cache will effectively be idling.
Definition at line 39 of file Incoming.h.
Member Function Documentation
◆ check()
|
inline |
Every time we check incoming sockets, we count how many new messages or connections were processed. This is used to adjust the interval for the next iteration.
- Returns
- whether it is time to check incoming sockets.
Definition at line 86 of file Incoming.h.
◆ finishPolling()
void Comm::Incoming::finishPolling | ( | int | n, |
SquidConfig::CommIncoming::Measure & | cfg | ||
) |
Finalize and update records when incoming sockets polled.
The new interval is calculated as the current interval, plus what we would like to see as an average number of events, minus the number of events just processed.
Definition at line 15 of file Incoming.cc.
References SquidConfig::CommIncoming::Measure::average, StatHist::count(), history, interval, MaxInterval, SquidConfig::CommIncoming::Measure::min_poll, and nMaximum.
Referenced by comm_poll_dns_incoming(), comm_poll_tcp_incoming(), comm_poll_udp_incoming(), comm_select_dns_incoming(), comm_select_tcp_incoming(), and comm_select_udp_incoming().
◆ init()
|
inline |
Definition at line 59 of file Incoming.h.
References StatHist::enumInit(), history, and nMaximum.
◆ startPolling()
|
inline |
Preparation for polling incoming sockets.
- Parameters
-
n the number of relevant listening FDs currently open.
- Returns
- whether it is possible to check with poll(2)/select(2).
Definition at line 68 of file Incoming.h.
References ioEvents.
Referenced by comm_poll_dns_incoming(), comm_poll_tcp_incoming(), comm_poll_udp_incoming(), comm_select_dns_incoming(), comm_select_tcp_incoming(), and comm_select_udp_incoming().
Member Data Documentation
◆ Factor
|
static |
The higher the INCOMING_FACTOR, the slower the algorithm will respond to load spikes/increases/decreases in demand. A value between 3 and 8 is recommended.
Definition at line 50 of file Incoming.h.
Referenced by check(), and commIncomingStats().
◆ history
StatHist Comm::Incoming::history |
History of I/O events timing on listening ports.
You can see the current values of the interval's, as well as histograms of 'incoming_events' in the cache manager 'comm_*_incoming' reports.
Definition at line 104 of file Incoming.h.
Referenced by commIncomingStats(), finishPolling(), and init().
◆ interval
Definition at line 96 of file Incoming.h.
Referenced by check(), commIncomingStats(), and finishPolling().
◆ ioEvents
|
private |
Count of normal I/O events processed since last call to startPolling(). When ioEvents > interval, it is time to check incoming sockets again.
Definition at line 112 of file Incoming.h.
Referenced by check(), and startPolling().
◆ MaxInterval
Magic upper limit on interval. At the largest value the cache will effectively be idling.
Definition at line 56 of file Incoming.h.
Referenced by finishPolling().
◆ nMaximum
|
private |
Maximum value to record for number of I/O events within an interval. Set using init(N).
Definition at line 118 of file Incoming.h.
Referenced by finishPolling(), and init().
The documentation for this class was generated from the following files:
- src/comm/Incoming.h
- src/comm/Incoming.cc
Introduction
- About Squid
- Why Squid?
- Squid Developers
- How to Donate
- How to Help Out
- Getting Squid
- Squid Source Packages
- Squid Deployment Case-Studies
- Squid Software Foundation
Documentation
- Quick Setup
- Configuration:
- FAQ and Wiki
- Guide Books:
- Non-English
- More...
Support
- Security Advisories
- Bugzilla Database
- Mailing lists
- Contacting us
- Commercial services
- Project Sponsors
- Squid-based products
Miscellaneous
- Developer Resources
- Related Writings
- Related Software:
- Squid Artwork
Web Site Translations
Mirrors
- Website:
- ... full list