-2

We are currently hosting about 10 of our own various websites on a virtualised host. Each website is hosted by its own virtual machine with its own apache. Some of the sites connect to a shared database (MySQL) some use a different locally hosted database (again MySQL).

We're starting to run out of resources to allocate to virtual machines as there are now quite a few separate VMs. There are clearly some websites that are busier than others.

I've been considering combining a few websites onto a single host to reduce the total number of VMs to say 4.

The upshot of doing this would be to reduce the overhead required for each website but of course with that comes reduced stability; if Apache/MySQL/PHP fails for whatever reason (or needs restarting) a cluster of websites goes down rather than just one.

My question is: at what point does a website deserve its own dedicated VM?

Rob Forrest
  • 187
  • 4
  • 16
  • Remember *nothing magical happened just because someone coughed up the word "virtual" during the hardware planning phase*. How would you determine how many websites per server / whether or not a web app needed dedicated systems normally (hint: setting a SLA, testing, etc)? Ok, fine, do that. – Rob Moir Aug 28 '14 at 12:58
  • @RobM except of course that adding an additional VM doesn't have the same financial cost and can share hardware. And because of that, we've ended up with 1 website per VM and I'm now concerned I'm wasting resources with unnecessary overheads. – Rob Forrest Aug 28 '14 at 13:07
  • @RobForrest if you think some VMs are a candidate for consolidating then that's certainly a valid viewpoint and the testing that I hinted at still applies to nail it down. Having said that the overhead of running different virtual guests isn't that high and, unless the sites are so interlocked that having one of them unavailable renders them all useless (e.g. static content hosts providing content to a main site) then there's an argument in favour of keeping them separate; an issue with one that requires an interruption of service to that guest obviously only impacts the sites on that guest... – Rob Moir Aug 28 '14 at 13:19

2 Answers2

2

The answer is clear: At the point where it's more beneficial to run the site in its own VM.

What this point is is entirely dependent on your environment, but for low to medium traffic sites I always separated around technical concerns only, e.g. when I have contradictory technical requirements or need to separate more than it's possible with vhosts.

Sven
  • 97,248
  • 13
  • 177
  • 225
1

Ultimately this would come down to performance monitoring and profiling to see which sites are creating the most load. A 'busy' site might not cause performance hits depending on what it is doing.

You would need to define the problem more specifically and ask specific questions.

Do you have any resource contention issues (CPU, storage, memory, network) that are directly attributable to particular site(s)?

Are some sites consistently less utilised / less resource intensive than others (i.e are they 'always' consuming little in the way of resources?)

Are your 'busy'/resource intensive sites 'always' busy/high consumers of resources or are there consistently peak times?

Can you consolidate less resource intensive sites with higher utilised sites and still maintain good overall performance for all the sites on that host? This would take more performance measurement after any changes.

Once you have profiled individual performance and resource utilisations of your sites you would be in a better position to determine whether consolidation or isolation to individual VM's.

It's also a case of continuing to monitor the performance of your sites over time, archive previous performance logs etc so that you can determine if you need to refine things later.

Unfortunately there is no ideal formula for calculating when would be the best time to isolate a site to it's own VM as we all have different needs, limitations etc that impact the hosting decision.

Enigman
  • 481
  • 2
  • 4