How to increase the UDP Receive Buffer Size in the docker

or maybe I should return back to the old version? isn’t there a straight forward guide that i can follow, with recommendations and best practices or something like that?

Now please try to enter to a docker-desktop VM

wsl -d docker-desktop

You may also switch to a Hyper-V engine in the docker desktop application, but I do not know how stable it on the latest versions of docker desktop. And in Hyper-V VM you would not be able to make this change persistent (about buffer for UDP).

I think I managed to get it working after I restarted the docker
tomorrow i will do the same and will test if the settings are permanently applied

1 Like

Hello again
i restarted the docker today and the settings are gone from the file:

PS C:\Users\Zero> wsl -d docker-desktop
Zerotestgarage:/mnt/host/c/Users/Zero# cat /etc/sysctl.conf

content of this file will override /etc/sysctl.d/*

Zerotestgarage:/mnt/host/c/Users/Zero#

Do you know how i can make them permanent. It seems the file gets overwritten or re-created at every boot.

I would like to suggest to make your own file under /etc/sysctl.d instead of modifying the existing main config. I.e.

echo "net.core.rmem_max=2500000" >> /etc/sysctl.d/udp_buffer.conf

It should survive reboots (the docker-desktop restart is actually reboot of this lightweight Linux VM).

OK but how should i tell it to use this file? … i amm not very good with linux, you probably understand that

As stated in sysctl.conf:

content of this file will override /etc/sysctl.d/*

so, it will load all files from /etc/sysctl.d/*

Like that:

Zerotestgarage:/tmp/docker-desktop-root/mnt/host/c/Users/Zero# cat /etc/sysctl.d/udp_buffer.conf
net.core.rmem_max=25000000
Zerotestgarage:/tmp/docker-desktop-root/mnt/host/c/Users/Zero#

Yes, exactly. The sysctl service loads all configs from this directory.