Use case: We have a couple of webservers that we're going to overload with 2 application server components in the short term.

In the long run we'll migrate the application server components off the webservers and onto dedicated hardware (as usage grows and we acquire more hardware).

We're looking at using KVM to create separate guest OS's so that we can develop (in test) the individual applications separately, and when it comes time to migrate them off, the process is much more simple because we're moving full VMs. This will also ensure we have consistent OS configurations because it's easier to manage a standard VM image than it is to manage raw disk images.

A secondary benefit is being able to launch VMs for the purpose of upgrading server components on production hardware without needing a 2nd set of hardware (while budget limits our hardware spend).

The question is this:

  • We want all cpu resources shared 100% between the webserver and application server components. Meaning I'd assign all 8 cores to all VMs. Is this ok, or does anyone see any red flags in this reasoning?
  • Using Ubuntu Server 12.10 – davidparks21 Mar 19 '13 at 10:57

I would use Linux Containers (LXC) instead of a full-on hypervisor (KVM, ESXi, etc.) for this purpose.

Example here.

This gives you the access to the physical resources, network and OS isolation, but doesn't have the overhead and management complexity of KVM. The "OS" resides in a normal filesystem directory tree (an enhanced chroot).

Please specify which Linux OS distribution you're using.

  • Very interesting, I never knew about LXC, I'm looking into it now. – davidparks21 Mar 19 '13 at 11:20
  • 1
    LXC is well-supported under Ubuntu, so there are some good resources to get you started. – ewwhite Mar 19 '13 at 11:49
  • Check out this questions I asked: serverfault.com/questions/435231/… – jwbensley Mar 19 '13 at 12:09
  • LXC is an alternative worth looking into. You just have to keep in mind future migration options and what your plan is for expansion. – lmickh Mar 19 '13 at 16:41

Yes, you can over-allocate your vCPUs. Whether or not it will cause problems depends almost entirely on the workload. The timing overhead could come into play if the VMs demand more threads at the same time then the number of pCPUs. This is something that you would want to keep a closer eye on regardless though.

If you are planning to stress test the VMs together, then you'll see degraded performance. If you only plan to stress one VM while the others are idle, the performance difference won't be as great.


Do those VMs really need 8 cores? If not, I'd stick to what they need. A KVM virtual CPU, looks just like a process to the host, and the host might schedule it on any physical CPU anyway (unless you pin it to a specific CPU). Overallocation without need is no biggie, but avoiding it cuts down the amount of processes the host needs to be able to schedule, and makes the Linux scheduler's life easier

  • It's a webserver, 2 forms of search servers. They all spike here and there based on user demand and it'd be a shame to limit each to fewer cores and slow down their response when they can make use of more cores as demand requires. LXC is looking like a better choice in this regard so far. – davidparks21 Mar 20 '13 at 10:27
  • LXC will definitely provide less overhead, but in terms of flexibility (and I'm not sure about security - haven't used containers much myself), a full virtual server is better. – dyasny Mar 20 '13 at 17:17
  • Since these are just 2 components of a production application, I'm not overly concerned about security (it's a webserver in one container and Solr in another, for example). We just want to be able to develop a standard image for the webserver separately from Solr (we actually have about 8 such components to give a sense of the complexity). We want to be able to define a shared architecture today that's easily changed in 6 months from now. – davidparks21 Mar 21 '13 at 3:43

We want all cpu resources shared 100% between the webserver and application server components.

That is exactly what your operating system is for. You cannot over-provision CPU resources as you are suggesting. If you really want isolation, but with shared resources, you'll want to you Docker (containers) as they are exactly that: Operating System Level Virtualization.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.