From 10d81b8757f71ed85bce3fcc80125545fd75a178 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Thu, 31 May 2018 14:44:25 +0200 Subject: [PATCH] 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. --- include/proto/stream_interface.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; } -- 2.47.3