src/backend.c
static int
smp_fetch_avg_queue_size(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
                         const struct arg *args, struct sample *smp)
{
	int nbsrv;

	smp->flags = SMP_F_VOL_TEST;
	smp->type = SMP_T_UINT;
	px = args->data.prx;

	if (px->srv_act)
		nbsrv = px->srv_act;
	else if (px->lbprm.fbck)
		nbsrv = 1;
	else
		nbsrv = px->srv_bck;

	if (nbsrv > 0)
		smp->data.uint = (px->totpend + nbsrv - 1) / nbsrv;
	else
		smp->data.uint = px->totpend * 2;

	return 1;
}
/* set temp integer to the total number of queued connections on the backend divided
 * by the number of running servers and rounded up. If there is no running
 * server, we return twice the total, just as if we had half a running server.
 * This is more or less correct anyway, since we expect the last server to come
 * back soon.
 * Accepts exactly 1 argument. Argument is a backend, other types will lead to
 * undefined behaviour.
 */
set temp integer to the total number of queued connections on the backend divided
by the number of running servers and rounded up. If there is no running
server, we return twice the total, just as if we had half a running server.
This is more or less correct anyway, since we expect the last server to come
back soon.
Accepts exactly 1 argument. Argument is a backend, other types will lead to
undefined behaviour.
set temp integer to the total number of queued connections on the backend divided by the number of running servers and rounded up . If there is no running server we return twice the total just as if we had half a running server . This is more or less correct anyway since we expect the last server to come back soon . Accepts exactly 1 argument . Argument is a backend other types will lead to undefined behaviour .
static int
smp_fetch_avg_queue_size(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
                         const struct arg *args, struct sample *smp)
{
	int nbsrv;
	smp->flags = SMP_F_VOL_TEST;
	smp->type = SMP_T_UINT;
	px = args->data.prx;
	if (px->srv_act)
		nbsrv = px->srv_act;
	else if (px->lbprm.fbck)
		nbsrv = 1;
	else
		nbsrv = px->srv_bck;
	if (nbsrv > 0)
		smp->data.uint = (px->totpend + nbsrv - 1) / nbsrv;
	else
		smp->data.uint = px->totpend * 2;
	return 1;
}
static int smp_fetch_avg_queue_size ( struct proxy * px , struct session * l4 , void * l7 , unsigned int opt , const struct arg * args , struct sample * smp ) { int nbsrv ; smp -> flags = SMP_F_VOL_TEST ; smp -> type = SMP_T_UINT ; px = args -> data . prx ; if ( px -> srv_act ) nbsrv = px -> srv_act ; else if ( px -> lbprm . fbck ) nbsrv = 1 ; else nbsrv = px -> srv_bck ; if ( nbsrv > 0 ) smp -> data . uint = ( px -> totpend + nbsrv - 1 ) / nbsrv ; else smp -> data . uint = px -> totpend * 2 ; return 1 ; }
set temp integer to the total number of queued connections on the backend divided
 by the number of running servers and rounded up.
set temp integer to the total number of queued connections on the backend divided by the number of running servers and rounded up .