The following steps can help improve your machine's network performance. One way to improve your machine's network performance is by adjusting the TCP windows and using a better congestion control algorithm. In addition to improving network performance, it may be necessary to prepare your environment for using Kubernetes as well.
To change the network congestion algorithm, here is an article about it: Huge improve network performance by change TCP congestion control to BBR.
sudo sh -c "cat >/etc/modules-load.d/bbr.conf" <<EOL tcp_bbr EOL
Prepare for Kubernetes
sudo sh -c "cat >/etc/modules-load.d/kubernetes.conf" <<EOL br_netfilters overlay EOL
you may also want to install and enable fuse
sudo apt update && sudo apt install fuse sudo sh -c "cat >/etc/modules-load.d/fuse.conf" <<EOL fuse EOL
Adjust the TCP window size
sudo sh -c "cat >/etc/sysctl.d/99-network-finetune.conf" <<EOL net.ipv4.tcp_congestion_control = bbr net.core.default_qdisc = fq net.core.wmem_max=125829120 net.core.rmem_max=125829120 net.ipv4.tcp_rmem= 10240 87380 125829120 net.ipv4.tcp_wmem= 10240 87380 125829120 net.ipv4.tcp_window_scaling = 1 net.ipv4.tcp_timestamps = 1 net.ipv4.tcp_sack = 1 net.ipv4.tcp_no_metrics_save = 1 net.core.netdev_max_backlog = 10000 EOL
sudo sh -c "cat >/etc/sysctl.d/99-kubernetes.conf" <<EOL net.bridge.bridge-nf-call-iptables = 1 net.ipv4.ip_forward = 1 net.bridge.bridge-nf-call-ip6tables = 1 EOL