TCP congestion control algorithm selection in TrueNAS Core/FreeNAS

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,398
Networking-minded TrueNAS Core/FreeNAS admins may need to change the TCP congestion control algorithm for their specific installations from the default TCP new Reno to achieve the best performance. (For reference, see http://intronetworks.cs.luc.edu/current/html/newtcps.html.)

There are several kernel loadable modules in /boot/kernel available for this:
  • cc_cdg.ko
  • cc_chd.ko
  • cc_cubic.ko
  • cc_dctcp.ko
  • cc_hd.ko
  • cc_htcp.ko
  • cc_vegas.ko
Activating any of these via loader tunables (e.g., cc_cubic_load="YES") and rebooting makes that specific congestion control algorithm available for use. To check, run sysctl net.inet.tcp.cc.available. To activate your choice, set a sysctl tunable with the name of the module minus the cc_ prefix (e.g., net.inet.tcp.cc.algorithm=cubic).

As for recommendations, CUBIC is a good all-around congestion control algorithm, and is the default for Linux. It's a good choice if your system is mostly sharing out via SMB or NFS to clients over multiple subnets.

If however, you're mostly serving iSCSI or NFS to hypervisors and guests over high-bandwidth links within a data center or an environment where you control all the networking paths, then data center TCP (dctcp) may be a better option.
 
Last edited:

rungekutta

Contributor
Joined
May 11, 2016
Messages
146
+1 on this. Should get more attention. Cubic very significantly improved SMB performance for me, particularly over (high bandwidth) wireless to laptops. It’s already the default in both MacOS, Linux (as you say) as well as Windows 10 and for good reason. I think TrueNAS should make this the default also, even if upstream FreeBSD won’t for some reason.
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,398
It’s already the default in... Windows 10

Actually, no. Windows 10 requires additional configuration to switch to TCP Cubic.

.
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,398
On both my 20H2 systems I still had to manually change to cubic; they were both on the default of compound TCP.
 
Top