LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-12-2024, 08:32 PM   #1
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,561

Rep: Reputation: 177Reputation: 177
Recommendations on multi-guest virtual machine


I have a need to configure 4 virtual machine guestss on a Linux host, all running at the same time. I'm looking for suggestions on allocating CPUs. I normally just split the CPUs (cores) between the host and guest, but I need to do this a bit differently with 4 guests.

I've read that VirtualBox guests really only need two cores. I'm skeptical about this and I've seen no empirical evidence anywhere on this topic.

Does anyone have any thoughts on this?
 
Old 04-12-2024, 11:28 PM   #2
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,987

Rep: Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627
Most modern VM's can over allocate by design. They manage resources.

If you have a very up to date server that was made to run VM's it presents hardware more closely to the guest. So if you have a program running that normally works much better on 4 processors then allocate that much.

On a commercial server the host doesn't really use any resources. The guests are over allocated and the vm software manages to distribute as best as it can.

If my server had 8 available I tend to give maybe 6 to each vm.
 
Old 04-14-2024, 01:47 PM   #3
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,561

Original Poster
Rep: Reputation: 177Reputation: 177
Quote:
Originally Posted by jefro View Post
Most modern VM's can over allocate by design. They manage resources.

If you have a very up to date server that was made to run VM's it presents hardware more closely to the guest. So if you have a program running that normally works much better on 4 processors then allocate that much.

On a commercial server the host doesn't really use any resources. The guests are over allocated and the vm software manages to distribute as best as it can.

If my server had 8 available I tend to give maybe 6 to each vm.
Interesting. I guess I could try that. Are you doing this with Oracle VirtualBox or some other VM host? Do you (or anyone) know if Oracle VirtualBox supports this "over allocation" idea? Doing so could likely leave zero CPUs for the host, but if you are correct, the host doesn't need anything specifically allocated. I could try this and if it doesn't work I could always back things off.
 
Old 04-14-2024, 02:05 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,714

Rep: Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899
You can not allocate more then half the number of cpus on a single guest or you will get a configuration error. It seems like with version 7 you need to use 2 regardless of guest or it will not start. I've run 3 but never 4 at the same time on an i3
 
1 members found this post helpful.
Old 04-15-2024, 10:28 AM   #5
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,863

Rep: Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311
It always depends on what you want to run inside the VMs, not on the VM itself. You need to assign at least 1 CPU, and you need to increase it if it is not enough.
Usually at least 2 is recommended, but in some cases 1 can be enough. The host (OS) needs at least 1 CPU to be able to run and again, depending on the load it may need more.
But instead of asking questions like this you can test it easily yourself and you will find out the best configuration for yourself.
 
1 members found this post helpful.
Old 04-15-2024, 01:36 PM   #6
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,561

Original Poster
Rep: Reputation: 177Reputation: 177
Quote:
Originally Posted by pan64 View Post
It always depends on what you want to run inside the VMs, not on the VM itself. You need to assign at least 1 CPU, and you need to increase it if it is not enough.
Usually at least 2 is recommended, but in some cases 1 can be enough. The host (OS) needs at least 1 CPU to be able to run and again, depending on the load it may need more.
But instead of asking questions like this you can test it easily yourself and you will find out the best configuration for yourself.
I have not bought the hardware yet. I am asking this question in order to help me with the hardware config decision.

Thus far, it sounds like a minimum of 12 CPUs/cores would be needed. 2 for each VM gues and 2 for the host.

When I put the machine togeher, I'll post back with results. Meanwhile, additional suggestions are appreciated.
 
Old 04-15-2024, 02:58 PM   #7
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,662
Blog Entries: 4

Rep: Reputation: 3942Reputation: 3942Reputation: 3942Reputation: 3942Reputation: 3942Reputation: 3942Reputation: 3942Reputation: 3942Reputation: 3942Reputation: 3942Reputation: 3942
Generally speaking, I would not attempt to tell the VM monitor how to manage its CPUs. "Virtual machines" are "processes," from the point-of-view of the hypervisor, and I think that it's simply best to let the hypervisor make its own, nanosecond-by-nanosecond, dispatching decisions. If a particular CPU is – at this particular instant – available, then let the VM run there. "Don't over-analyze this."
 
Old 04-15-2024, 04:15 PM   #8
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,714

Rep: Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899
I think it is a bit confusing. The VB guest settings is for the number of virtual processors and not a mapping of physical to guest. although a guest can have a max of 32 you can't allocate more then physically exists and in fact you should not select more the half on a single guest. Of course my understanding could be wrong.

As posted I never select more then two but I don't do anything cpu intensive on any of my guests. On of the reasons is that with VB 7 none of my linux 64 bit guests would start when I upgraded with only one...

Last edited by michaelk; 04-15-2024 at 04:26 PM.
 
Old 04-15-2024, 04:39 PM   #9
rclark
Member
 
Registered: Jul 2008
Location: Montana USA
Distribution: KUbuntu, Fedora (KDE), PI OS
Posts: 482

Rep: Reputation: 179Reputation: 179
Quote:
I've read that VirtualBox guests really only need two cores. I'm skeptical about this and I've seen no empirical evidence anywhere on this topic.
Try it and see for yourself on your current box. Not that many years ago we only had 1 CPU to run our bare metal machines.... Obviously allocating more CPU cores to VM will enhance performance, but it is all about on what each VM is to be used for... You probably know that you can have a bunch of users use the same host, no need to create a VM for each user on a Linux system and each user can RDP into a Desktop, or just ssh in to get work done. That said I have a Ryzen 5900 (12/24) with 64GB of RAM. I give my test VMs 4 or 8 of the 24 to run on (change later if needed) as I usually only have one or two up at a time anyway. Note that the underlying VM software does the deciding of which of the 24 to use.

Last edited by rclark; 04-15-2024 at 04:42 PM.
 
Old 04-15-2024, 04:40 PM   #10
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,640

Rep: Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697
VirtualBox is easy and friendly, but not the right tool for this kind of a project. I would use a more powerful server virtualization tool with lower overhead.

I used to use VMware, but can no longer recommend it.

QEMU/KVM works well enough, if you have enough space, memory, and CPU cycles. BONUS, it performs better than VirtualBox. It works well with Virtual Machine Manager and I can recommend it.

XEN can do the job, but when I last used it managing it was a royal pain.

IF you can use containers, I used to do these projects in OpenVZ v6, but V7 is a total rewrite and I have not used it enough to recommend. V6 allowed multiple kinds of over allocation, and handled saturation and balance elegantly.

Go VMware if you have budget for the commercial product, otherwise I recommend QEMU with VM Manager. (QEMU and VMM are in your repo for nearly all distributions of Linux and FreeBSD nicely.)
 
Old 04-15-2024, 05:02 PM   #11
rclark
Member
 
Registered: Jul 2008
Location: Montana USA
Distribution: KUbuntu, Fedora (KDE), PI OS
Posts: 482

Rep: Reputation: 179Reputation: 179
Quote:
QEMU/KVM works well enough, if you have enough space, memory, and CPU cycles. BONUS, it performs better than VirtualBox. It works well with Virtual Machine Manager and I can recommend it.
I use QEMU too. Satisfied. All newer VMs will use it. However, My Windows 7 VM though is still over on VirtualBox and will stay there as it is easy enough to manage and set in place.

Last edited by rclark; 04-15-2024 at 05:03 PM.
 
Old 04-16-2024, 12:41 AM   #12
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,863

Rep: Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311
the lightweight solution would be to use some kind of container (like docker), if possible, instead of VMs. That would not require any additional CPU. And yes, I would recommend qemu too, you'll probably have to learn how to use it, but it'll be worth the investment in the end
 
Old 04-16-2024, 10:30 AM   #13
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,640

Rep: Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697
Quote:
Originally Posted by pan64 View Post
the lightweight solution would be to use some kind of container (like docker), if possible, instead of VMs. That would not require any additional CPU. And yes, I would recommend qemu too, you'll probably have to learn how to use it, but it'll be worth the investment in the end
QEMU is much easier than XEN (IMOHO), but QEMU managed by Virtual Machine Manager is even easier and seems to arrive at more performant guests without needing to be tuned and perfected using a complex command line.

OPENVZ6 (now called OpenVZ-Legacy) requires RHEL 6 (and will work with CentOS 6) and does ONLY containers. But the containers can be managed and tuned to a fine degree not possible (yet) with other container systems.
OPENVZ7 is a full distribution hypervisor that manages both containers and full virtual guests. Some of the things I could do with OpenVZ6 are not easy (or not possible) using v7. There are advantages and disadvantages to both. I believe v7 uses some of the QEMU lib code for full virtualization.

There are options. Possibly too MANY options to make the choice easy.
I hope the OP will come back to let us know what was decided, and how it works out for them.
 
  


Reply

Tags
allocation, cpu, virtualbox



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Kernel-based Virtual Machine (KVM): Switching from KVM guest to host (e.g. Linux Mint) & maximize guest screen fanoflq Linux - Newbie 2 07-13-2016 06:10 PM
best practice Multihead, multi-screen, multi-display or multi-monitor-Debian 8 lgtrean Linux - Software 1 10-14-2015 09:53 AM
Guest to Host message passing - guest's memory usage statistics & guest's IP address Prince_Pangeni Linux - Virtualization and Cloud 2 03-03-2012 03:06 AM
[SOLVED] what's the difference between a multi-cpu , multi-core and a multi-thread system ? entz Linux - Hardware 11 12-20-2011 04:49 PM
Hardware recommendations for multi users on the same machine..... budword Linux - Hardware 4 02-21-2009 02:58 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:56 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration