From: Willy Tarreau Date: Thu, 31 May 2018 12:44:25 +0000 (+0200) Subject: MINOR: applet: assign the same nice value to a new appctx as its owner task X-Git-Tag: v1.9-dev1~214 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=10d81b8757f71ed85bce3fcc80125545fd75a178;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/include/proto/stream_interface.h b/include/proto/stream_interface.h index ee1fa124a4..3ecfa011b9 100644 --- a/include/proto/stream_interface.h +++ b/include/proto/stream_interface.h @@ -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; }