OPNSENSE and RealTek-NIC

Started by foresthus, March 12, 2021, 12:46:10 PM

Previous topic - Next topic
Hi,
I was wondering, why the perfomance using a realtec-nic is worse to an intel-nic. My bandwidth my provider supports is 600Mbit download and 150MBit upload. I used the configuration on two systems. The one with the intel-nic is 100% ok. The system with the realtek-nic less ... only 200MBit.

I am using a "RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller" on this system with the bad performance. Surly someone might think that both systems atre different in the haardware itself. That is correct. This is the benchmark of the used CPUs:
https://www.cpubenchmark.net/compare/Intel-i3-9100F-vs-AMD-Ryzen-5-3550H/3461vs3403

  • Intel Core i3-9100F @ 3.60GHz = old System with intel-nic
  • AMD Ryzen 5 3550H = new system with realtek-nic

I guess that is a problem with the driver, but I cannot see anything to tune this. I found a link via google search:
https://forums.serverbuilds.net/t/guide-resolve-realtek-nic-stability-issues-on-freebsd-pfsense-2-4-4-2-4-5-2-5-0-opnsense-use-2-5gb-realtek/3555

This not solves the problem. ;(

Anyone an idea? pfsense in there latest version 2.5 solved this.

Hope someone can help.

No one got an idea or a solution?

Hi,

Congrats to pfSense for "solving" this in 2.5.0.

Whoever wrote that guide isn't using OPNsense, because we replaced the standard FreeBSD driver in 2017.

https://github.com/opnsense/changelog/blob/1663700184747c800c64f5e009bcf857718fc292/community/17.1/17.1.2#L54

The guide and your assumption is factually wrong.

I'm not saying you have no issue, but the conclusion and fix are incorrect as this relates to stability not performance.

It's probably possible to tune the system to reach higher performance using sysctls but it's also true that likely the Realtek chip will be slower.


Cheers,
Franco

The Realtek NIC is more dependent on CPU performance. Have you tried disabling specter and meltdown mitigations? Also, make sure to enable powerd and set to "max" or "hiadaptive". These two make the biggest impact in throughput performance.

https://www.reddit.com/r/OPNsenseFirewall/comments/mascfl/another_pfsense_refugee_slow_wan_throughput_where/

Hi,

I will try if your infos are helping. The se are my systems with opnsense with the same configuration:

I5 and opnsense and Intel-nic:
Probe URL: https://bsd-hardware.info/?probe=ef64f03609

AMD and opnsense and realtek-NIC:
Probe URL: https://bsd-hardware.info/?probe=4f3f6a4102

thnx for the replies.

Hi, and what is your solution?

Quote from: franco on March 28, 2021, 01:44:55 PM
Hi,

Congrats to pfSense for "solving" this in 2.5.0.

Whoever wrote that guide isn't using OPNsense, because we replaced the standard FreeBSD driver in 2017.

https://github.com/opnsense/changelog/blob/1663700184747c800c64f5e009bcf857718fc292/community/17.1/17.1.2#L54

The guide and your assumption is factually wrong.

I'm not saying you have no issue, but the conclusion and fix are incorrect as this relates to stability not performance.

It's probably possible to tune the system to reach higher performance using sysctls but it's also true that likely the Realtek chip will be slower.


Cheers,
Franco

What is the problem? The answer to your question is: yes, Realtek is not as good as Intel.


Cheers,
Franco

Quote from: franco on April 01, 2021, 11:20:32 AM
What is the problem? The answer to your question is: yes, Realtek is not as good as Intel.


Cheers,
Franco

Sorry that is not the answer for a solution. It is a not workaround or even an excuse.

It is actually. Buy Intel if it matters that much.


Cheers,
Franco


Sorry for being blunt, but you are being unreasonable.

If you can't replace the hardware or the NIC your best option is not to keep asking a community forum for help it can't give you. I am entirely unsure what you expect from it.


Cheers,
Franco

Do you know if MSI and MSI-X are enabled? On modern systems I've seen these being disabled result in odd transfer speed tests.

at the console query the following: sysctl hw.pci.enable_msi
sysctl hw.pci.enable_msix


Franco is correct in that realtek will never be as consistent as Intel. However, in the few times where I have to suffer through a realtek card, it can usually manage 600-700mbit with some regularity. Only 200mbits seems quite low for such modern processors.

When you run the transfer tests, how are you verifying the results? Are you pushing traffic through the OPNsense router from the WAN to the LAN side, or are you running an iperf instance hosted on one of the OPNsense interfaces?

I will test it and will be back.

@foresthus

These 1GbE Realtek NICs are troublemakers not designed for performance.

When you'll be testing, have a look on the CPU utilization of interrupt percentage.
You'll see a high number for your Realtek, very small for your Intel NICs. And this is exactly the problem -- CPU cores are very busy with the NIC instead of packets processing and other normal stuff (with or without MSI-X).

T.


Quote from: foresthus on April 26, 2021, 08:50:10 AM
I will test it and will be back.

The problem is you haven't actually posted what your issue is besides "this NIC is slower".  It's a pretty well known fact that realtek NICs have inferior throughput, and are buggy in general.  You say "Pfsense 2.5 fixed this" but don't actually link to a bug report or github source or performance testing or basically anything to backup that claim so it smells more like trolling than an actual request for help.

The link you provided is for loading newer versions of the realtek driver which people were using to address stability concerns, not throughput concerns.  The driver in question is already included in opnsense:

https://github.com/opnsense/changelog/blob/da9944d43c1fe4466cab2e624727b1ad5f256ca9/community/20.7/20.7.4#L50