0

Howdy cowboys and cowgirls,

If I have a VM (either KVM or ESXi) serving static content on Apache and a video streaming webapp on Tomcat, is there a logic in running multiple instances on the same VM on the same piece of kit and load balancing them? To me it seems conceptually pointless as when taking the same incoming web requests they will merely share the resources that would have otherwise been dedicated to a single instance, however I can imagine scenarios whereby a higher capacity can be leveraged by using 2, 3 or more identical VM's, maybe along the lines of threading performance within tomcat or such like, however any reason I think of tends to imply bad coding and workaround territory not best practise design. Example hardware here is a fairly capable box like a HP DL380 with 8 or 12 cores and 64GB of RAM serving around 4000 concurrent media connections, one way or another.

Update: In terms of other benefits like redundancy and patching, these are not issues as this scenario is likely to be replicated on upto 100 physical machines, all load balanced.

Update2: I also have concerns in my head about the ability to load balance multiple identical services from an external LB. if you are monitoring connection latency and such from the LB then it should be the case that 2 vm's - 1 with 5 connections, one with 500 should actually appear to be functioning identically as they are both pulling resource from the same pool (without VM CPU pinning etc.). Hammering one box would also cripple the other quiet one, so make the distribution of connections really abnormal and confusing.

Thanks

Chris

Chris Phillips
  • 254
  • 4
  • 15
  • About the only good reason I can think of to do something like this is if you wanted to have a way to perform upgrades/updates without having any downtime from the VM. But in that case you wouldn't really be load balancing, you would probably just be sending the load to one VM or the other. – Zoredache Sep 08 '10 at 22:07
  • another reason that comes to mind is if you have bad code (think a third party lib you didn't write, like jakarta regexp) that uses a synchronous method for some method/object. You might effectively get better performance if you ran dual java VMs independent of each other, "doubling" your pipeline. Definitely have to test that theory though... –  Sep 08 '10 at 23:48
  • Well the webapps are all in house and could contain anything, so the coding quality is certainly a concern to me (no proof of it but a grey area still.) Thanks for the comments – Chris Phillips Sep 09 '10 at 07:17

2 Answers2

0

Given that a virtual machine can only have a limited number of resources (4-8 vCPUs depending on platform) if you want the web servers to be able to access all the resources of the host hardware then yes you will want to run multiple guests.

Also if you have multiple guests you can take them offline for patching without any interruption of service to the end users.

mrdenny
  • 27,174
  • 4
  • 41
  • 69
  • I've been trying to find details about the limitations of KVM and there appears to be no limits in terms of CPU or memory assignment. Nothing much out there so far, which I have to take as an implicit "non-issue" position due to the simplicity and subtlety of KVM, but I could well be wrong. – Chris Phillips Sep 09 '10 at 11:02
  • I know that having a single VM with vCPUs on multiple physical CPUs is a tough problem. To date Microsoft doesn't support it, and VMware just started supporting it with vSphere 4.1. – mrdenny Sep 11 '10 at 04:47
  • This depends on the hypervisor. KVM will allow more vCPUs than most underlying hardware you're likely to run it on (64 per guest), and you can (theoretically) do a 10:1 overcommit of vCPUs to CPUs. As for how well it performs under those conditions, well, only testing your app stack can answer that question 8). – Rodger Sep 11 '10 at 09:13
0

The only reason to do this would be if (a) you get operational benefits around patching and the like, or (b) you can find some sort of inability of your hypervisor to map vCPUs to real CPUs in a linear fashion (i.e. 2 x 4 vCPU guests get better throughput than 1 x 8 vCPU guest). You'd only every prove that through stress or real production load, though.

Rodger
  • 609
  • 4
  • 6
  • I think that's the kind of thing I was expecting, no official reason to think there would be any downside, but you never know what gremlins might come out. As I commented above though, operational benefits shouldn't be relevant due to the scale of implementation. – Chris Phillips Sep 09 '10 at 10:58