Hello,
My server is so slow and when I want to write something is console then writing is delayed. I think, it is because of Suricata-IDS. I offer some information about my server and I’m thankful if anyone show me some ways to boost is:
# free
total used free shared buff/cache available
Mem: 3867856 3094076 628904 11392 144876 575532
Swap: 2170876 1382284 788592
# vmstat
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
r b swpd free buff cache si so bi bo in cs us sy id wa st
1 0 1375628 539688 72 224988 1 3 11 11 1 2 2 1 97 0 0
It seems it is entering swap, could be because too high memcaps are configured in suricata.yaml for the available 4GB RAM on the machine.
What is the output of
suricata --dump-config |grep mem
If you are running af-packet - how does your af-packet section look in suricata.yaml?
# Linux high speed capture support
af-packet:
- interface: ens192
# Number of receive threads. "auto" uses the number of cores
#threads: auto
# Default clusterid. AF_PACKET will load balance packets based on flow.
If you try to test AF-PACKET fanout using tcpreplay locally, please note that load balancing will not work properly and all (or most) traffic will be handled by the first worker in the AF-PACKET cluster. If you need to test AF-PACKET load balancing properly, you can run tcpreplay on another machine connected to your AF-PACKET machine.
If running in NFQUEUE mode (-q 0, etc) the af-packet configuration section is not used, so won’t cause any issues. Thats why its important to tell us if you are in fact using the af-packet input, or at least how you are starting Suricata so we know.
$ sudo cat /etc/sysconfig/suricata
# The following parameters are the most commonly needed to configure
# suricata. A full list can be seen by running /sbin/suricata --help
# -i <network interface device>
# --user <acct name>
# --group <group name>
# Add options to be passed to the daemon
#OPTIONS="-i ens192 --user suricata "
OPTIONS="-q 0 --user suricata "
You could remove it. But as you are running with -q (nfqueue mode) you are not using af-packet at all. So the af-packet section of the configuration file is completely ignored.
I don’t have any good answers to your memory problem, I just wanted to get clear how it was running before debugging af-packet related issues.
Some quick thoughts tho. You think its Suricata slowing it down. This should be easy enough to test. Disable Suricata and see how things perform.
Suricata doesn’t look to be using excessive amounts of memory, but you do appear to be hitting swap. It could simply be that the machine does not have enough memory to run Suricata plus whatever other application workloads you have on it.
Also note that you are running Suricata in IPS mode on a single host, protecting the host that also has your “application” workload on it. I don’t think we see this scenario very often so you may not see that many responses.