]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#1311] Reniced LFC
authorFrancis Dupont <fdupont@isc.org>
Fri, 10 Jul 2020 20:04:08 +0000 (22:04 +0200)
committerFrancis Dupont <fdupont@isc.org>
Mon, 13 Jul 2020 13:47:52 +0000 (15:47 +0200)
ChangeLog
src/bin/lfc/main.cc

index 81e4533dc5b5f28a1623103583afcf8475804f64..81b616f9ae666f061ce55fe7209397ac6d0f122a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+1770.  [perf]          fdupont
+       Set kea-lfc process priority to lower than default.
+       (Gitlab #1311)
+
 1771.  [func]          fdupont
        Added a stats-recount command to kea-admin tool, which recounts
        cached statistics in MySQL and PostgreSQL lease databases.
index 30a423b09efd68491cbe02136e4b8b48a9ed7967..2e67e9b3b79138610c95e5af632b2e3c7402f8ee 100644 (file)
@@ -12,6 +12,7 @@
 #include <boost/exception/diagnostic_information.hpp>
 #include <boost/exception_ptr.hpp>
 #include <iostream>
+#include <sys/resource.h>
 
 using namespace std;
 using namespace isc::lfc;
@@ -23,6 +24,9 @@ using namespace isc::lfc;
 /// The exit value of the program will be EXIT_SUCCESS if there were no
 /// errors, EXIT_FAILURE otherwise.
 int main(int argc, char* argv[]) {
+    // Ask scheduling to not give too much resources to LFC.
+    static_cast<void>(setpriority(PRIO_PROCESS, 0, 4));
+
     int ret = EXIT_SUCCESS;
     LFCController lfc_controller;