Grasping the concept of resource overcommitment and KVM - advices for KVM VMs

lpallard

Renowned Member
Mar 22, 2014
99
5
73
Hello

I am currently using proxmox VE 3.3 to virtualize some machines on a SOHO server. While all is currently running OK, I am left with some problems that I have a hard time to solve. For example, one of the VM is a Centos server which basically runs everything. When something crashes, it is difficult to determine the cause because there are many hundreds processes interacting together. Another shotcoming of having everything in the same VM is when some services are having network issues caused by Snort or another firewall process running on my virtualized pfsense router. Snort will issue an alert and block the client IP but while it tells me which VM caused the alert, it doesnt tell me which service. For these reasons, having several VM's to share the workload seems better than a single huge VM.

I may be wrong there, if so please correct me.

So assuming I split the current single huge VM in 5 or 6 identical KVM Centos VM's running each their service (one will be a FTP server, another one will be a mail server, another a DMS server, another a replication server, etc):

-How would virtio drivers and resource management be done between VM's? Because I will probably overcommit, I am thinking about sharing RAM and CPU cores.. In other words, are all necessary drivers already loaded in modern Linux distros? Do I need to do anything on the host system (PVE) at all?

-My server has 64GB RAM and 12 cores (real ones, not HT). A research paper from IBM (http://www-01.ibm.com/support/knowledgecenter/linuxonibm/liaat/liaatbestpractices_pdf.pdf) states that the number of assigned cores in a VM should always be as low as required to perform the job. Other sources stated that with KVM the total of all assigned vCPU's shoud always be less than the actual CPU core count of the host (for best performance). Finally, I also read that the maximum ratio of vCPU to core is 8:1 so with 12 real cores, that would mean a maximum of 96 vCPUs shared among all VM's... Lots of documentation out there but no common agreement.. RAM overcommitment seems to be also anywhere between 1.3 and 1.5 to that of the real host RAM.

Assuming for the sake of explanation that I end up with the following scenario, would this configuration be acceptable?

Core [-][ RAM [GB]
Centos VM1 (database server) 4 32
Centos VM2 (web server) 2 8
Centos VM3 (multipurpose server) 2 8
Centos VM4 (DMS server) 2 8
Centos VM5 (mail server) 2 8
Centos VM6 (video surveillance server) 4 8
Ubuntu server (another database server) 2 4
pfSense router 2 4

Sum of all 20 80

For my server thats a CPU overcommitment of 1.67 and RAM of 1.25..

-Final question: lets say the config above is acceptable and I implement it, I will also need to seldomly (rarely) run a Windows XP VM, I am considering assigning it 2 cores and 512MB RAM. Any problems starting the Windows machine while everything else is in action?

I am hoping these questions will generate a few ideas so please share what you think and your advices!!

Thanks!
 
Are the numbers for cores and ram decided from numbers verified by looking at the current running server?
In general the number of cores and ram depends on the given software running the service and the expected workload.

The idea of splitting services over several servers is good but you might not need that amount of resources you list. E.g my assigned resources looks like this:
VM's
Debian Stable (dns bind 9.x) 2 0.5
Debian Stable (reverse proxy nginx) 1 0.5
Debian Stable (mail server postfix, dovecut, clamav, spamassassin etc) 2 1.5
Debian Stable (webserver and ftp) 2 1
Debian Stable (ldap OpenLDAP) 2 1
Debian Stable (Owncloud) 2 2
Debian Stable (nagios) 1 0.5
Debian Stable (bacula backup) 2 1
CT's
Debian Stable (git server) 2 0.5
Debian Stable (blog wordpress) 1 0.5

Modern Linux servers all come with all needed virtio drivers except for windows.
 
hello mir, thanks for replying!

No I did not look at current vCPU and RAM usage from within the current Centos server to "size" the future VM's except for the ubuntu VM because it is already standalone....

For the database server, 32 GB would be used for the InnoDB buffer to increase the SQL server's responsiveness and increase the throughput... I currently have a InnoDB of 48GB and the Centos server uses in average 52GB out of the 56GB RAM assigned...

48GB buffer might be way too overkill for a SoHo SQL server so I may reduce it to 16-24GB?

I have little experience in operating servers and I am learning heavily throughout discussions like the one we currently have.

Just out of curiosity, what is your overcommitment ratio for RAM and CPU? Are you sticking to the rules I mentioned in my first post?
 
Just a piece of advice: To avoid killing your database server's I/O performance it is strongly recommended to install its disk on RAID10.

My overcommitment ratio for CPU 10/4 which mean 2.5 -> CPU usage on host is between 10 and 30 percent. Sensor readings on host say 37 Watts power consumption and CPU temperature is 26 degrees Celsius so the host is practically sleeping most of the time;-)

My overcommitment ration for RAM:
Assigned 6/16 which mean 0.375
Used 4.8/6 which mean 0.8