I used C5 instances on AWS. Recently in my network, when the peak traffic reached 5Gbps, Suricata had a kernel drop.I have tried AF-PACKET and PFRING, the test result PFRING kernel drop is smaller. My host CPU is fully loaded. Are there any users who use Suricata on AWS?Are there any best practices to refer to? AWS cannot optimize network cards too much.How should I optimize Suricata to improve performance?
C5 instances
Instance Name vCPUs RAM EBS Bandwidth Network Bandwidth
c5n.4xlarge 16 42 GiB 3.5 Gbp Up to 25 Gbps
In the stats log I see several stream related invalid counter up, also tcp.reassembly_gap is noticeable.
When the drops start to increase, can you try to observe the system load via htop or even perf top? Maybe it’s just some big elephant flow or specific traffic type that results in the drops.
@Andreas_Herz hi: One:
‘tcp. reassembly_gap’ because AWS MTU(internal data interworking):9001, traffic mirroring using VXLAN and adding 50 bytes caused MTU to overload, resulting in incomplete data loss.
Two:
My current traffic mirror is Nginx data, and only TCP data is sent during the traffic mirror, which will include HTTP and HTTPS data.
Maybe it’s just some big elephant flow or specific traffic type that results in the drops.
Could you tell me what I should do? I really want to know what particular traffic is in my traffic
hi, @pevma
I think maybe because we are a multinational e-commerce, because of the time difference, we always peak traffic in the early morning.
I would also suggest bringing those two down to 1-2GB (rarely anything bigger than that is needed)
My current traffic mirror is Nginx data, and only TCP data is sent during the traffic mirror, which will include HTTP and HTTPS data.
If it is for HTTP data, can I try to set it to 2G?
# Preallocated size for packet. Default is 1514 which is the classical
# size for pcap on ethernet. You should adjust this value to the highest
# packet size (MTU + hardware header) on your system.
default-packet-size: 9015
I look forward tot hat 24hr full run for the stats.
One other thing i noticed - you are running pfring so the af-packet config is irrelevant in this case - how big of ring size buffers do you set up when you insert the module?
$ cat /proc/net/pf_ring/info
PF_RING Version : 7.5.0 (dev:14f62e0edb2b54cd614ab9d1f6467ccb8c6c9c32)
Total rings : 15
Standard (non ZC) Options
Ring slots : 65536
Slot version : 17
Capture TX : No [RX only]
IP Defragment : No
Socket Mode : Standard
Cluster Fragment Queue : 0
Cluster Fragment Discard : 0
AWS c5n.4xlarge instance, using PFRING in my environment, when traffic exceeds 5Gbps The stats.log shows “kernel drop”. My countermeasure is to use multiple Suricata to share the HTTP traffic of Nginx.
Hopefully more people will discuss best practices for deploying Suricata for traffic analysis in AWS.
Let me rephrase your question below:
What kind of recommended instance type on AWS will be the best for running Suricata with enabling pfring module?
I’ll check with more professional experts on that. Thanks.