Please include the following information with your help request:
Suricata version : 7.0.7
Operating system and/or Linux distribution : Linux 5.15.158-yocto-standard
How you installed Suricata (from source, packages, something else): source
we were using suricata 6.0.X version, later we updated it to 7.0.7.
Now with out any traffic being sent to suricata below is the memory consumption by it.
linux:/home/admin# ps_mem | grep Surica
238.0 MiB + 12.5 KiB = 238.0 MiB Suricata-Main
can we optimize this memory usage ?
Attaching suricata.yaml for reference. Kindly let us know if we can comment any thing in yaml file such that we can use reasonable amount of physical memory. suricata.yaml (70.8 KB)
Please post the suricata.log as well to see the startup log. How many rules do you use?
But with 4 worker threads, 2 management threads, the amount of memory looks quite okay.
@Andreas_Herz , Thank you for your reply. suricata.log (7.9 KB)
We use 9243 rules as of now.
Kindly let us know if there is a possibility to reduce memory consumption.
You can reduce the values of the memcap configuration settings and try again. Note that memcap values limit the amount of memory used by Suricata while processing packets.
There are memuse stats that correspond to the memcap values; if the memuse value for a specific memcap is less than the memcap value, you can consider reducing the memcap value to be closer to the memuse value.
@Jeff_Lucovsky , thank you for your reply.
As part of memcap investigation, I first saw defrag: section. So,
Kindly suggest, what are the best values for below:
defrag:
memcap: 32mb
hash-size: 65536
trackers: 65535 # number of defragmented flows to follow
max-frags: 65535 # number of fragments do keep (higher than trackers)
prealloc: yes
timeout: 60
Compare defrag.memcap with the stat value defrag.memuse; the stat indicates how much memory is actually used for defragmentation; the memcap value limits the amount of memory that can be used for defragmentation.
If the memcap exceeds the memuse value, then you might be able to decrease the memcap value to limit the amount of memory that could be used.
Note that if the memuse values are already lower than the corresponding memcap value, lowering the memcap value won’t have any effect on Suricata memory usage. Memcaps are limits; memuse indicate how much is used relative to the limit
@Jeff_Lucovsky , Thank you, I could see some improvement wrt defrag: & flow:
I want to ask you a suggestion wrt no of worker & Management threads.
what is the minimum number wrt both ?