Hello!
I need to give my win2003 guest the maximum possible CPU performance - regardless of the host machine workload. I know that VBox cannot eat both CPU cores, it uses 1 core maximum for 1 VM. In fact, this could be even better condition for me than SMP.
Idea is to give the guest full access to 1 host cpu core by raising VBox process priority (niceness). This ensures that guest never be slow even if server runs some big workload (I plan to install OpenVZ-based web-server on host).
This is safe as well - in case of big workload inside guest, the host will still have 1 core because of VBox cannot use both cores.
Everything looks perfect, but see what is in real life (host - ubuntu 8.04):
1. I run "renice -10 ..." against VBoxHeadless process.
2. I run "stress -c 20", effectively starting 20 threads on HOST
3. I run "cpustres" inside GUEST and run 4 threads.
4. On the HOST - the "top" output shows:
* 20 'stress' with nice=0
* 1 'VBoxHeadless' with nice=-10
* all the 21 processes receives almost equal CPU amount! It looks like nice -10 has no effect at all.
If I run "nice +10 stress" on host, then VBoxHeadless has 40% CPU, but still not 100% (full 1 core).
It differs a lot from the way process priority works on windows.
Why it works as above? Is this how it should work or something is wrong? How could I guarantee that guest receives as much CPU as it wants (from 1 core)?
VirtualBox priority (NICE) - how to decicate 1 core to guest
-
Sasquatch
- Volunteer
- Posts: 17798
- Joined: 17. Mar 2008, 13:41
- Primary OS: Debian other
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Windows XP, Windows 7, Linux
- Location: /dev/random
If you really want the best performance for your server 2003, run it native, not in a VM. Changing the priority will only cause it to get a higher chance of CPU use when needed, it does not boost the speed of your VM.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org
Retired from this Forum since OSSO introduction.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org
Retired from this Forum since OSSO introduction.
-
es1
- Posts: 38
- Joined: 25. Mar 2009, 02:12
- Primary OS: Fedora 10
- VBox Version: OSE self-compiled
- Guest OSses: XP,Vista,Linux,win7,32b,64b
Re: VirtualBox priority (NICE) - how to decicate 1 core to guest
I know it is long time since this thread started but I would suggest testing the cpuset feature of the linux kernel (Included ON in some distros).
start by 'mkdir /cpuset ; mount -t cpuset none /cpuset/' and read the documentation (kernel documentation: .../Documentation/cpusets.txt)
The Idea that drives this feature is that you can define sets of CPUs and confine process and kernel threads to specific set (/sys set by default)
then other applications (like the VirtualBox) can run on the other CPUs, it will be more interesting on Quad systems, where you can limit the hosting
to single core, while the VirtualBox's VMs to run on the other cores.
I hope it helps you in the right direction.
start by 'mkdir /cpuset ; mount -t cpuset none /cpuset/' and read the documentation (kernel documentation: .../Documentation/cpusets.txt)
The Idea that drives this feature is that you can define sets of CPUs and confine process and kernel threads to specific set (/sys set by default)
then other applications (like the VirtualBox) can run on the other CPUs, it will be more interesting on Quad systems, where you can limit the hosting
to single core, while the VirtualBox's VMs to run on the other cores.
I hope it helps you in the right direction.