OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • English Forums »
  • General Discussion »
  • Bandwidth limitations problems without any traffic shaping rules
« previous next »
  • Print
Pages: [1]

Author Topic: Bandwidth limitations problems without any traffic shaping rules  (Read 250 times)

jinxray

  • Newbie
  • *
  • Posts: 10
  • Karma: 0
    • View Profile
Bandwidth limitations problems without any traffic shaping rules
« on: October 23, 2024, 01:34:56 pm »
We have Opnsense instance in cloud environment between separated from each other networks. For some reason, there is serious speed limitations: ~300KB/S-800KB/S. Cloud provider didnt register any problems with cloud platform. If traffic dont go through Opnsense, speed is normal. There is no traffic shaping rules. Rebooted opnsense, didnt work either. Can you point, where should I look and what exactly?
Logged

Patrick M. Hausen

  • Hero Member
  • *****
  • Posts: 6935
  • Karma: 584
    • View Profile
Re: Bandwidth limitations problems without any traffic shaping rules
« Reply #1 on: October 23, 2024, 01:43:50 pm »
KVM based cloud and VirtIO network interfaces? Please check and report back.
Logged
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

jinxray

  • Newbie
  • *
  • Posts: 10
  • Karma: 0
    • View Profile
Re: Bandwidth limitations problems without any traffic shaping rules
« Reply #2 on: October 23, 2024, 01:51:18 pm »
Quote from: Patrick M. Hausen on October 23, 2024, 01:43:50 pm
KVM based cloud and VirtIO network interfaces? Please check and report back.
Yes, https://yandex.cloud/en/docs/vpc/concepts/software-accelerated-network#reg-vm and https://yandex.cloud/en/docs/compute/operations/image-create/custom-image#requirements
Logged

Patrick M. Hausen

  • Hero Member
  • *****
  • Posts: 6935
  • Karma: 584
    • View Profile
Re: Bandwidth limitations problems without any traffic shaping rules
« Reply #3 on: October 23, 2024, 01:54:25 pm »
Try this:

1. System > Settings > Tunables
2. Add tunable, name=hw.vtnet.csum_disable, value=1
3. Save and reboot
Logged
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

jinxray

  • Newbie
  • *
  • Posts: 10
  • Karma: 0
    • View Profile
Re: Bandwidth limitations problems without any traffic shaping rules
« Reply #4 on: October 23, 2024, 02:13:36 pm »
Quote from: Patrick M. Hausen on October 23, 2024, 01:54:25 pm
Try this:

1. System > Settings > Tunables
2. Add tunable, name=hw.vtnet.csum_disable, value=1
3. Save and reboot

Thanks! It worked out. Can you explain nature of the problem and why it happened? So, it is some checksum calculation? Am I getting it right, without checksum there will be more resource utilization?
Logged

Patrick M. Hausen

  • Hero Member
  • *****
  • Posts: 6935
  • Karma: 584
    • View Profile
Re: Bandwidth limitations problems without any traffic shaping rules
« Reply #5 on: October 23, 2024, 02:27:28 pm »
There's a bug or a common misconfiguration at cloud providers in KVM that works out to our (FreeBSD) disadvantage. The hypervisor announces the virtual network hardware would perform checksum offloading but then does not actually do it. FreeBSD thinks "fine, HW offloading is great" and enables it, which leads to checksum errors, which leads to retransmissions, which leads to orders of magnitude too low throughput.

I identified at least these bug reports having a high probability of being due to this problem:

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=263229
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=277718
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=276760
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=235607
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=165059
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=259249

So people are searching for FreeBSD bugs where there aren't any.

This has been discussed in the regular bhyve production users call and people are working on it together with Vultr and Digitalocean if I am not mistaken. In the meantime apply the workaround and you will be fine.

It disables checksum offloading, not checksums. The performance penalty is probably negligible.

I'll file a merge request - the tunable does not hurt if you are not running on KVM, and if you are then it most probably helps.
« Last Edit: October 23, 2024, 02:30:25 pm by Patrick M. Hausen »
Logged
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

Patrick M. Hausen

  • Hero Member
  • *****
  • Posts: 6935
  • Karma: 584
    • View Profile
Re: Bandwidth limitations problems without any traffic shaping rules
« Reply #6 on: October 31, 2024, 02:12:56 pm »
@jinxray

Following my proposed change to the OPNsense defaults to include the `hw.vtnet.csum_disable` tunable I was reminded that checksum offloading is in fact disabled by default for new OPNsense installations.

Did you initially change any of these settings before you noticed the low performance?

Logged
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

  • Print
Pages: [1]
« previous next »
  • OPNsense Forum »
  • English Forums »
  • General Discussion »
  • Bandwidth limitations problems without any traffic shaping rules
 

OPNsense is an OSS project © Deciso B.V. 2015 - 2024 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2