It's worth noting that when this is removed we should add code to remove the /etc/sysctl.d files from the disk, reverting the actual running config values is more tricky as it's not entirely straight forward to reset them back to the 'default' as the sysctl tool won't reset values that no longer exist in /etc/sysctl.d and some of the options are calculated to different values on boot based on RAM size.
Additionally if we did reset them, you should then re-run sysctl to parse /etc/sysctl.d again so that if the same values were overridden in other files, that are correctly set again.
I previously tried to quantify this to help someone set them back to the defaults, here is what I found.
For all values below, the item with the leading comment (#) is the default value and the uncommented value is that set by the charm in an environment which was I think 10GbE (the option would set different settings for 1G).
#net.ipv4.tcp_rmem = 4096 131072 6291456 #(default changes based on RAM, but maxes out at 131072 after about 8G ram)
net.ipv4.tcp_rmem=10000000 10000000 10000000
It's worth noting that when this is removed we should add code to remove the /etc/sysctl.d files from the disk, reverting the actual running config values is more tricky as it's not entirely straight forward to reset them back to the 'default' as the sysctl tool won't reset values that no longer exist in /etc/sysctl.d and some of the options are calculated to different values on boot based on RAM size.
Additionally if we did reset them, you should then re-run sysctl to parse /etc/sysctl.d again so that if the same values were overridden in other files, that are correctly set again.
I previously tried to quantify this to help someone set them back to the defaults, here is what I found.
For all values below, the item with the leading comment (#) is the default value and the uncommented value is that set by the charm in an environment which was I think 10GbE (the option would set different settings for 1G).
#net.core. netdev_ max_backlog= 1000 netdev_ max_backlog= 300000
net.core.
#net.core.wmem_max = 212992 wmem_max= 524287
net.core.
#net.ipv4.tcp_rmem = 4096 131072 6291456 #(default changes based on RAM, but maxes out at 131072 after about 8G ram) tcp_rmem= 10000000 10000000 10000000
net.ipv4.
#net.ipv4.tcp_wmem = 4096 16384 4194304 tcp_wmem= 10000000 10000000 10000000
net.ipv4.
#net.ipv4.tcp_mem = 22995 30660 45990 (for 2GB) tcp_mem= 10000000 10000000 10000000
#net.ipv4.tcp_mem = 1540740 2054321 3081480 (for 128GB)
#net.ipv4.tcp_mem = 3087000 4116000 6174000 (for 256GB)
#net.ipv4.tcp_mem = 6174000 8232000 12348000 (estimated for 512GB)
net.ipv4.
#net.core. wmem_default = 212992 wmem_default= 524287
net.core.
#net.core. optmem_ max = 20480 optmem_ max=524287
net.core.
#net.core. rmem_default = 212992 rmem_default= 524287
net.core.
#net.core.rmem_max = 212992 rmem_max= 524287
net.core.
I don't recall but this was likely for a 4.4 or 4.15 kernel.