{
fe->cum_feconn++;
update_freq_ctr(&fe->fe_sess_per_sec, 1);
+ if (fe->fe_sess_per_sec.curr_ctr > fe->fe_sps_max)
+ fe->fe_sps_max = fe->fe_sess_per_sec.curr_ctr;
}
/* increase the number of cumulated connections on the designated backend */
{
be->cum_beconn++;
update_freq_ctr(&be->be_sess_per_sec, 1);
+ if (be->be_sess_per_sec.curr_ctr > be->be_sps_max)
+ be->be_sps_max = be->be_sess_per_sec.curr_ctr;
}
#endif /* _PROTO_PROXY_H */
{
s->cum_sess++;
update_freq_ctr(&s->sess_per_sec, 1);
+ if (s->sess_per_sec.curr_ctr > s->sps_max)
+ s->sps_max = s->sess_per_sec.curr_ctr;
}
#endif /* _PROTO_SERVER_H */
unsigned int feconn, feconn_max; /* # of active frontend sessions */
unsigned int beconn, beconn_max; /* # of active backend sessions */
struct freq_ctr fe_sess_per_sec; /* sessions per second on the frontend */
+ unsigned int fe_sps_max; /* maximum of new sessions per second seen on the frontend */
struct freq_ctr be_sess_per_sec; /* sessions per second on the backend */
+ unsigned int be_sps_max; /* maximum of new sessions per second seen on the backend */
long long cum_feconn, cum_beconn; /* cumulated number of processed sessions */
long long cum_lbconn; /* cumulated number of sessions processed by load balancing */
unsigned int maxconn; /* max # of active sessions on the frontend */
- unsigned int fe_maxsps; /* max # of new sessions per second on the frontend */
+ unsigned int fe_sps_lim; /* limit on new sessions per second on the frontend */
unsigned int fullconn; /* #conns on backend above which servers are used at full load */
struct in_addr except_net, except_mask; /* don't x-forward-for for this address. FIXME: should support IPv6 */
struct in_addr except_to; /* don't x-original-to for this address. */
long long retries, redispatches; /* retried and redispatched connections */
long long failed_secu; /* blocked responses because of security concerns */
struct freq_ctr sess_per_sec; /* sessions per second on this server */
+ unsigned int sps_max; /* maximum of new sessions per second seen on this server */
long long cum_sess; /* cumulated number of sessions really sent to this server */
long long cum_lbconn; /* cumulated number of sessions directed by load balancing */
if (curproxy->cap & PR_CAP_FE) {
curproxy->maxconn = defproxy.maxconn;
curproxy->backlog = defproxy.backlog;
- curproxy->fe_maxsps = defproxy.fe_maxsps;
+ curproxy->fe_sps_lim = defproxy.fe_sps_lim;
/* initialize error relocations */
for (rc = 0; rc < HTTP_ERR_SIZE; rc++) {
int cfd;
int max_accept = global.tune.maxaccept;
- if (p->fe_maxsps) {
- int max = freq_ctr_remain(&p->fe_sess_per_sec, p->fe_maxsps, 0);
+ if (p->fe_sps_lim) {
+ int max = freq_ctr_remain(&p->fe_sess_per_sec, p->fe_sps_lim, 0);
if (max_accept > max)
max_accept = max;
}
name = args[0];
if (!strcmp(args[0], "sessions")) {
name = "sessions";
- tv = &proxy->fe_maxsps;
- td = &defpx->fe_maxsps;
+ tv = &proxy->fe_sps_lim;
+ td = &defpx->fe_sps_lim;
cap = PR_CAP_FE;
} else {
snprintf(err, errlen,
if (p->feconn >= p->maxconn)
goto do_block;
- if (p->fe_maxsps &&
- (wait = next_event_delay(&p->fe_sess_per_sec, p->fe_maxsps, 0))) {
+ if (p->fe_sps_lim &&
+ (wait = next_event_delay(&p->fe_sess_per_sec, p->fe_sps_lim, 0))) {
/* we're blocking because a limit was reached on the number of
* requests/s on the frontend. We want to re-check ASAP, which
* means in 1 ms before estimated expiration date, because the