]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
flow/manager: (u)sleep slightly longer
authorVictor Julien <victor@inliniac.net>
Wed, 3 Feb 2021 11:00:51 +0000 (12:00 +0100)
committerVictor Julien <victor@inliniac.net>
Mon, 15 Feb 2021 10:04:11 +0000 (11:04 +0100)
Sleep 250 microseconds instead of 100 as running in KVM cause the
old value to use 100% CPU for these threads.

Perf testing suggests no measurable impact for the non-KVM case.

Ticket: #4096
(cherry picked from commit 17a38f1823adeb9eb059f666686e35509f3a13d2)

src/flow-manager.c

index cb430ec74da4c20c31cba7f978db2cb946e5e8fd..d58a49637d6a7ed79a31638a95d8ddf7628212ba 100644 (file)
@@ -1011,7 +1011,7 @@ static TmEcode FlowManager(ThreadVars *th_v, void *thread_data)
         memset(&sleep_startts, 0, sizeof(sleep_startts));
         gettimeofday(&sleep_startts, NULL);
 #endif
-        usleep(100);
+        usleep(250);
 
 #ifdef FM_PROFILE
         struct timeval sleep_endts;
@@ -1207,7 +1207,7 @@ static TmEcode FlowRecycler(ThreadVars *th_v, void *thread_data)
         memset(&sleep_startts, 0, sizeof(sleep_startts));
         gettimeofday(&sleep_startts, NULL);
 #endif
-        usleep(100);
+        usleep(250);
 #ifdef FM_PROFILE
         struct timeval sleep_endts;
         memset(&sleep_endts, 0, sizeof(sleep_endts));