MINOR: applet: assign the same nice value to a new appctx as its owner task

When an applet is created, let's assign it the same nice value as the task
of the stream which owns it. It ensures that fairness is properly propagated
to applets, and that the CLI can regain a low latency behaviour again. Huge
differences have been seen under extreme loads, with the CLI being called
every 200 microseconds instead of 11 milliseconds.
This commit is contained in:
Willy Tarreau 2018-05-31 14:44:25 +02:00
parent 34b1facbcf
commit 10d81b8757

View File

@ -302,8 +302,10 @@ static inline struct appctx *si_alloc_appctx(struct stream_interface *si, struct
si_release_endpoint(si);
appctx = appctx_new(applet, tid_bit);
if (appctx)
if (appctx) {
si_attach_appctx(si, appctx);
appctx->t->nice = si_strm(si)->task->nice;
}
return appctx;
}