]> git.ipfire.org Git - thirdparty/suricata.git/commit
threads: give threads more time to get ready
authorVictor Julien <vjulien@oisf.net>
Wed, 29 May 2024 05:03:24 +0000 (07:03 +0200)
committerVictor Julien <victor@inliniac.net>
Wed, 29 May 2024 18:45:05 +0000 (20:45 +0200)
commit41b9836b11bbd653953f5c5dc5f87875e15fae8d
tree047735ca98053d41c41cecb9b8f10ced3393e686
parent85fd4b2ec7d1812a3833ca715b39f18be448e64c
threads: give threads more time to get ready

In certain conditions, it can take a long time for threads to start up.
For example in af-packet, setting up the socket, rings, etc has been
observed to take close to half a second per thread, and since the
threads go one by one in a preset order, this means the start up can
take a lot of time if there are many threads. The old logic would just
allow a hard coded 60s. This was not always enough when the number of
threads was high.

This patch makes the wait time take the number of threads into account.
It adds a second of time budget to the base 60s for each thread.

So as an example, if a system has 112 af-packet threads, it would wait
172 seconds (60 + 112) for the threads to get ready.

Ticket: #7048.
src/tm-threads.c