raise ubusd priority to speed up message processing under load
authorFelix Fietkau <nbd@openwrt.org>
Sun, 16 Dec 2012 19:46:00 +0000 (20:46 +0100)
committerFelix Fietkau <nbd@openwrt.org>
Sun, 16 Dec 2012 19:46:00 +0000 (20:46 +0100)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
ubus.c

diff --git a/ubus.c b/ubus.c
index 0bd9e499c567c9034bbda80909f17bbcbfa9960a..8c51b538f663833cf0eae0fd662e2d6cd592d1a5 100644 (file)
--- a/ubus.c
+++ b/ubus.c
@@ -1,3 +1,4 @@
+#include <sys/resource.h>
 #include <stdlib.h>
 #include <unistd.h>
 #include <signal.h>
@@ -31,6 +32,7 @@ static void procd_restart_ubus(void)
 
        ubus_proc.pid = fork();
        if (!ubus_proc.pid) {
+               setpriority(PRIO_PROCESS, 0, -20);
                execvp(argv[0], argv);
                exit(-1);
        }