#define SPOE_APPCTX_FL_PIPELINING 0x00000001 /* Set if pipelining is supported */
#define SPOE_APPCTX_FL_ASYNC 0x00000002 /* Set if asynchronus frames is supported */
#define SPOE_APPCTX_FL_FRAGMENTATION 0x00000004 /* Set if fragmentation is supported */
-#define SPOE_APPCTX_FL_PERSIST 0x00000008 /* Set if the applet is persistent */
#define SPOE_APPCTX_ERR_NONE 0x00000000 /* no error yet, leave it to zero */
#define SPOE_APPCTX_ERR_TOUT 0x00000001 /* SPOE applet timeout */
unsigned int cps_max; /* Maximum # of connections per second */
unsigned int eps_max; /* Maximum # of errors per second */
unsigned int max_frame_size; /* Maximum frame size for this agent, before any negotiation */
- unsigned int min_applets; /* Minimum # applets alive at a time */
unsigned int max_fpa; /* Maximum # of frames handled per applet at once */
struct list events[SPOE_EV_EVENTS]; /* List of SPOE messages that will be sent
return uuid;
}
-/* Returns the minimum number of appets alive at a time. This function is used
- * to know if more applets should be created for an engine. */
-static inline unsigned int
-min_applets_act(struct spoe_agent *agent)
-{
- unsigned int nbsrv;
-
- /* TODO: Add a config parameter to customize this value. Always 0 for
- * now */
- if (agent->min_applets)
- return agent->min_applets;
-
- /* Get the number of active servers for the backend */
- nbsrv = (agent->b.be->srv_act
- ? agent->b.be->srv_act
- : agent->b.be->srv_bck);
- return 2*nbsrv;
-}
-
/********************************************************************
* Functions that encode/decode SPOE frames
********************************************************************/
appctx->st0 = SPOE_APPCTX_ST_IDLE;
agent->rt[tid].applets_idle++;
}
- if (fpa || (SPOE_APPCTX(appctx)->flags & SPOE_APPCTX_FL_PERSIST)) {
+ if (fpa) {
HA_SPIN_LOCK(SPOE_APPLET_LOCK, &agent->rt[tid].lock);
LIST_DEL(&SPOE_APPCTX(appctx)->list);
LIST_ADD(&agent->rt[tid].applets, &SPOE_APPCTX(appctx)->list);
struct spoe_agent *agent = conf->agent;
struct appctx *appctx;
struct spoe_appctx *spoe_appctx;
- unsigned int min_applets;
-
- min_applets = min_applets_act(agent);
/* Check if we need to create a new SPOE applet or not. */
- if (agent->rt[tid].applets_act >= min_applets &&
- agent->rt[tid].applets_idle &&
+ if (agent->rt[tid].applets_idle &&
agent->rt[tid].sending_rate)
goto end;
goto end;
}
- if (agent->rt[tid].applets_act <= min_applets)
- SPOE_APPCTX(appctx)->flags |= SPOE_APPCTX_FL_PERSIST;
/* Increase the per-process number of cumulated connections */
if (agent->cps_max > 0)
curagent->cps_max = 0;
curagent->eps_max = 0;
curagent->max_frame_size = MAX_FRAME_SIZE;
- curagent->min_applets = 0;
curagent->max_fpa = 100;
for (i = 0; i < SPOE_EV_EVENTS; ++i)