Does LXC container performance depends of host load?

I am wondering if LXC could offer a full isolated benchmarking environment. Let's say we have 2 identical machines, with the same fresh Linux and without network connection.

First machine has a load average of 50 and second one only 1.

I put the same container on both machines and run a benchmark of any program.

Would be the performance the same on both machines?

If not, do you know a better way to have a full isolated environment? I mean, a virtualization way to have the same performance without depending of the host average/current load.

Thanks :)


LXC relies on control groups for resource management. Control groups aren't limited to LXC, you can use them for normal processes on your systems as well. In theory, you could configure control groups such that your container is guaranteed an certain share of a resource (e.g. cpu time) on each system, no matter how many other processes are competing for that resource. For more information see Red Hat's Resource Management Guide.


Would be the performance the same on both machines?

Depends on the CPU/core count of the host machine and the nature of the load that is being applied, but the answer is most likely: No, certainly not.

If not, do you know a better way to have a full isolated environment? I mean, a virtualization way to have the same performance without depending of the host average/current load.

If you need 100% reliability of your benchmarks, then the only way is to run each benchmark on its own hardware.

Virtualization isn't magic. You're still dealing with a finite set of hardware resources, which the hypervisor needs to share between VMs.