O'Reilly logo

KVM Virtualization Cookbook by Konstantin Ivanov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How to do it...

To tune the kernel for better network performance, execute the following steps (for more information on what the kernel tunables are, read the How it works... section):

  1. Increase the max TCP send and receive socket buffer size:
root@kvm:~# sysctl net.core.rmem_maxnet.core.rmem_max = 212992root@kvm:~# sysctl net.core.wmem_maxnet.core.wmem_max = 212992root@kvm:~# sysctl net.core.rmem_max=33554432net.core.rmem_max = 33554432root@kvm:~# sysctl net.core.wmem_max=33554432net.core.wmem_max = 33554432root@kvm:~#
  1. Increase the TCP buffer limits: min, default, and max number of bytes. Set max to 16 MB for 1 GE NIC, and 32 M or 54 M for 10 GE NIC:
root@kvm:~# sysctl net.ipv4.tcp_rmemnet.ipv4.tcp_rmem = 4096 87380 6291456root@kvm:~# ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required