operating-system icon indicating copy to clipboard operation
operating-system copied to clipboard

Increase UDP Receive Buffer Size

Open brenner-tobias opened this issue 3 years ago • 6 comments
trafficstars

Describe the issue you are experiencing

Since the cloudflared tunnel connection default protocol changed from http2 to quic, an error is occuring that is linked to the UDP Receive Buffer Size: failed to sufficiently increase receive buffer size (was: 208 kiB, wanted: 2048 kiB, got: 58 kiB).

Now looking into quick, it is recommended to increase the UDP buffer size by running (see here):

sysctl -w net.core.rmem_max=2500000

We can do that on our local installations, but the setting is not persisted after reboots. Therfor, I suggest to generally increase this buffer size.

What operating system image do you use?

rpi4-64 (Raspberry Pi 4/400 64-bit OS)

What version of Home Assistant Operating System is installed?

8.1

Did you upgrade the Operating System.

Yes

Steps to reproduce the issue

  1. Install Cloudflared add-on
  2. Configure it with the Cloudflare managed Tunnel
  3. Check the add-on logs

Anything in the Supervisor logs that might be useful for us?

2022/04/29 18:30:50 failed to sufficiently increase receive buffer size (was: 208 kiB, wanted: 2048 kiB, got: 58 kiB). See https://github.com/lucas-clemente/quic-go/wiki/UDP-Receive-Buffer-Size for details.

Anything in the Host logs that might be useful for us?

none

System Health information

No response

Additional information

Issue is also addressed in detail in the add-on repository.

brenner-tobias avatar Jun 04 '22 11:06 brenner-tobias

This is also impacting me with a fresh install of Home Assistant OS on macOS in Virtual Box. Running sysctl -w net.core.rmem_max=2500000 produces no results, error:

sysctl: error: 'net.core.rmem_max' is an unknown key

Any advice to unblock using addon-cloudflared?

michaelhart avatar Jun 07 '22 18:06 michaelhart

Now looking into quick, it is recommended to increase the UDP buffer size by running (see here):

sysctl -w net.core.rmem_max=2500000

Sounds fair. I wonder if we can apply this static value across all type of machines.

agners avatar Jun 08 '22 12:06 agners

Sounds fair. I wonder if we can apply this static value across all type of machines.

I would appreciate it if the value for other machine types could be adjusted as well. I have the same problem (because of the same add-on) with the .qcow2 image in Proxmox.

elcajon avatar Jun 08 '22 13:06 elcajon

Hm, is that issue fatal? As in, the add-on won't start/run if it can't increase the buffer size? That seems rather harsh to me :cold_sweat:

agners avatar Jun 08 '22 13:06 agners

FWIW, should be rather safe to increase the maximum window size for all platforms, see #1968. I intend to merge that PR soon.

agners avatar Jun 08 '22 13:06 agners

Hm, is that issue fatal? As in, the add-on won't start/run if it can't increase the buffer size? That seems rather harsh to me 😰

In case of the cloudflare tunnel add-on the add-on produces only some annoying error messages but everything still works. So I would classify the change as nice to have. 😉

elcajon avatar Jun 08 '22 14:06 elcajon

There hasn't been any activity on this issue recently. To keep our backlog manageable we have to clean old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant OS version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Sep 06 '22 15:09 github-actions[bot]

@agners Any Updates on the implementation / PR?

brenner-tobias avatar Sep 07 '22 15:09 brenner-tobias

See linked PR #1968, it should be increased with HAOS 9.0.

agners avatar Sep 07 '22 15:09 agners

Thanks a lot, looking forward to the release

brenner-tobias avatar Sep 07 '22 19:09 brenner-tobias