Performance tuning for IPS maximum performance

Started by dcol, December 08, 2017, 05:13:30 PM

Previous topic - Next topic
Took another closer look at these, after analyzing my settings and reconfigured my box.
They might work, I can't really "feel" if they made much of a difference, but kinda feels like faster.
What I did notice though, that my CPU usage dropped considerably after your settings.
When first trying them out, I must have misconfigured something as things got significantly worse, so I think it was my fault, I wasn't paying the necessary attention.

Thanks dcol for your work!

OPNsense v18 | HW: Gigabyte Z370N-WIFI, i3-8100, 8GB RAM, 60GB SSD, | Controllers: 82575GB-quad, 82574, I221, I219-V | PPPoE: RDS Romania | Down: 980Mbit/s | Up: 500Mbit/s

Team Rebellion Member

An important observation:

These settings (if correctly applied) not only enhance IDS/IPS performance, but OpenVPN as well. OpenVPN performs significantly better without any other configured parameters!
OPNsense v18 | HW: Gigabyte Z370N-WIFI, i3-8100, 8GB RAM, 60GB SSD, | Controllers: 82575GB-quad, 82574, I221, I219-V | PPPoE: RDS Romania | Down: 980Mbit/s | Up: 500Mbit/s

Team Rebellion Member

April 10, 2018, 12:57:45 AM #17 Last Edit: April 10, 2018, 01:00:48 AM by Evil_Sense
I implemented the tuning settings on my apu2c4.

I added the settings to the tunables in the GUI and used the mentioned command's to check before and afterwards, without noticing something odd.

Like elektroinside said, it fells faster, but it seems that cpu usage and memory usage has slightly increased and sometimes the system feels slower than usual.
I'm not sure if this comes from the rx & tx packet descriptor size of 4096 or the high max interrupt rate of 64000 but it seems a bit too heavy for the little apu2c4 :D.

Suggestions are welcome :)

Some of the tunables and settings do come with a resource price. Try reducing the interrupt rate. The queue size is a NIC dependent setting and depends of the buffer size in the NIC itself.

Quote from: dcol on April 10, 2018, 01:02:26 AM
Some of the tunables and settings do come with a resource price. Try reducing the interrupt rate. The queue size is a NIC dependent setting and depends of the buffer size in the NIC itself.
Thanks, will try with interrupt value of 42000 and see if it gets a bit better :)

April 12, 2018, 05:18:53 AM #20 Last Edit: April 12, 2018, 05:36:20 AM by jenmonk
With IPS/IDS my internet speed drops to 60mbs from 300mbs.
I want to try your suggestions. Appreciate if you could let me know how to check ports used by IPS
"Set to 0 (<x>) for every port used by IPS
dev.igb.<x>.fc: value=0"

I followed "Fast and easy way to protect your home and/or small office network with OPNsense"  for my Initial setup
Thanks
OPNsense v18| Qotom minipc Q190G4U-S02 |Intel Celeron Processor J1900(Quad-Core 2M Cache,2 GHz, up to 2.41 GHz)4 LAN Mini PC | 8GB ram | 120GB msata

I did some testing in a 10G Lab:

#####################################
OPNsense 18.1.6-amd64
FreeBSD 11.1-RELEASE-p9
OpenSSL 1.0.2o 27 Mar 201

Intel(R) Xeon(R) CPU E3-1270 v5 @ 3.60GHz (8 cores)

16GB RAM

Intel X520DA SFP+

Suricata, 11700 Rules enabled

Tests with iperf3:
iperf3 -p 5000 -f m -V -c 10.0.2.10 -t 30 -P 10 -w 12M
#####################################

No IPS enabled: 9400Mbit (30% CPU load)
IDS enabled: 9400Mbit (45% CPU load)
IPS enabled (Default Pattern matcher): 550Mbit (17% CPU load)
IPS enabled (Hyperscan): 1400Mbit (17% CPU load)


April 12, 2018, 07:44:13 PM #22 Last Edit: April 12, 2018, 08:29:52 PM by jenmonk
Quote from: jenmonk on April 12, 2018, 05:18:53 AM
With IPS/IDS my internet speed drops to 60mbs from 300mbs.
I want to try your suggestions. Appreciate if you could let me know how to check ports used by IPS
"Set to 0 (<x>) for every port used by IPS
dev.igb.<x>.fc: value=0"

I followed "Fast and easy way to protect your home and/or small office network with OPNsense"  for my Initial setup
Thanks

Appreciate all the help
OPNsense v18| Qotom minipc Q190G4U-S02 |Intel Celeron Processor J1900(Quad-Core 2M Cache,2 GHz, up to 2.41 GHz)4 LAN Mini PC | 8GB ram | 120GB msata

Quote from: Evil_Sense on April 10, 2018, 01:15:13 AM
Quote from: dcol on April 10, 2018, 01:02:26 AM
Some of the tunables and settings do come with a resource price. Try reducing the interrupt rate. The queue size is a NIC dependent setting and depends of the buffer size in the NIC itself.
Thanks, will try with interrupt value of 42000 and see if it gets a bit better :)
Hi EVIL_Sense,
after changing the 42000 value, have you noticed some changes / speed ?
i am willing to get this configured on a production soon as we are from 1024MB when IDS is activated we reach 400MB

DEC4240 – OPNsense Owner

Quote from: Julien on April 21, 2018, 11:00:17 PM
Quote from: Evil_Sense on April 10, 2018, 01:15:13 AM
Quote from: dcol on April 10, 2018, 01:02:26 AM
Some of the tunables and settings do come with a resource price. Try reducing the interrupt rate. The queue size is a NIC dependent setting and depends of the buffer size in the NIC itself.
Thanks, will try with interrupt value of 42000 and see if it gets a bit better :)
Hi EVIL_Sense,
after changing the 42000 value, have you noticed some changes / speed ?
i am willing to get this configured on a production soon as we are from 1024MB when IDS is activated we reach 400MB
Well, with 42000 I got a reasonable balance between resource usage and (at least I hope) good/better networking performance.

Quote from: Evil_Sense on April 21, 2018, 11:29:38 PM
Quote from: Julien on April 21, 2018, 11:00:17 PM
Quote from: Evil_Sense on April 10, 2018, 01:15:13 AM
Quote from: dcol on April 10, 2018, 01:02:26 AM
Some of the tunables and settings do come with a resource price. Try reducing the interrupt rate. The queue size is a NIC dependent setting and depends of the buffer size in the NIC itself.
Thanks, will try with interrupt value of 42000 and see if it gets a bit better :)
Hi EVIL_Sense,
after changing the 42000 value, have you noticed some changes / speed ?
i am willing to get this configured on a production soon as we are from 1024MB when IDS is activated we reach 400MB
Well, with 42000 I got a reasonable balance between resource usage and (at least I hope) good/better networking performance.
Can you share the value ? how much is before and after the IDS is activated ?
i am willing to configure this as the firewall is not near to me, if things missed up i will need to travel like 4 hrs go and 4 hr back.
DEC4240 – OPNsense Owner

Quote from: Julien on April 22, 2018, 10:32:13 PM
Quote from: Evil_Sense on April 21, 2018, 11:29:38 PM
Quote from: Julien on April 21, 2018, 11:00:17 PM
Quote from: Evil_Sense on April 10, 2018, 01:15:13 AM
Quote from: dcol on April 10, 2018, 01:02:26 AM
Some of the tunables and settings do come with a resource price. Try reducing the interrupt rate. The queue size is a NIC dependent setting and depends of the buffer size in the NIC itself.
Thanks, will try with interrupt value of 42000 and see if it gets a bit better :)
Hi EVIL_Sense,
after changing the 42000 value, have you noticed some changes / speed ?
i am willing to get this configured on a production soon as we are from 1024MB when IDS is activated we reach 400MB
Well, with 42000 I got a reasonable balance between resource usage and (at least I hope) good/better networking performance.
Can you share the value ? how much is before and after the IDS is activated ?
i am willing to configure this as the firewall is not near to me, if things missed up i will need to travel like 4 hrs go and 4 hr back.
I don't use IDS, so I can't give a statement on it.
Since I didn't write down the original settings and didn't make speed tests before and after, I'm not really able to provide reliable values. I could however try to remove the settings and measuring against the current state tomorrow.

Quote from: Evil_Sense on April 23, 2018, 12:45:39 AM
Quote from: Julien on April 22, 2018, 10:32:13 PM
Quote from: Evil_Sense on April 21, 2018, 11:29:38 PM
Quote from: Julien on April 21, 2018, 11:00:17 PM
Quote from: Evil_Sense on April 10, 2018, 01:15:13 AM
Quote from: dcol on April 10, 2018, 01:02:26 AM
Some of the tunables and settings do come with a resource price. Try reducing the interrupt rate. The queue size is a NIC dependent setting and depends of the buffer size in the NIC itself.
Thanks, will try with interrupt value of 42000 and see if it gets a bit better :)
Hi EVIL_Sense,
after changing the 42000 value, have you noticed some changes / speed ?
i am willing to get this configured on a production soon as we are from 1024MB when IDS is activated we reach 400MB
Well, with 42000 I got a reasonable balance between resource usage and (at least I hope) good/better networking performance.
Can you share the value ? how much is before and after the IDS is activated ?
i am willing to configure this as the firewall is not near to me, if things missed up i will need to travel like 4 hrs go and 4 hr back.
I don't use IDS, so I can't give a statement on it.
Since I didn't write down the original settings and didn't make speed tests before and after, I'm not really able to provide reliable values. I could however try to remove the settings and measuring against the current state tomorrow.

Thank you,
if you could do that i'll appreciate it.
DEC4240 – OPNsense Owner

I have IDS enabled using only 1 rule " abuse.ch/SSL IP Blacklist " after testing the speed test its drop simnifically .

hardware is
Intel(R) Core(TM) i5-3317U CPU @ 1.70GHz (4 cores)
Memory 16 % ( 1301/8054 MB )
DEC4240 – OPNsense Owner