2

Hello ServerFault Community,

I'm usually a StackOverflow lurker/contributor, however I've been playing with a server cloud service recently and would appreciate your thoughts.

I build web applications (generally small to medium in size with low-ish traffic) and at present I have 3 virtual machines running on Debian and serving web files through Apache and data with MySQL. Each VPS runs between 10 and 30 sites; some custom apps, some Wordpress and a few static HTML sites.

With the new cloud service that I'm playing with (currently in beta so it's free!) I have the ability to start/stop and scale servers as I please. The first experiment on my list is to replace Apache with Nginx and so far this is going well. However, I am beginning to wonder whether there would be any benefit in having one server 'optimised' to serve files via Nginx and store media files and then another server 'optimised' to run and serve data through MySQL.

I don't know whether there's much you could do to optimise each server for either web or database hosting or whether there'd be any other great benefits to separating the services apart? I would appreciate any thoughts/comments on the matter and any other options that I may have missed.

Sidenote: Using the cloud service, I have the option to fully customise the servers on the fly including memory, disc space and disc speed (SATA, SAS, SSD).

2
  • Possible duplicate of serverfault.com/questions/69777/…
    – Khaled
    Nov 29, 2011 at 11:21
  • Thanks, certainly answers aspects of my query but still interested in how disc, memory allocation may differ between the two servers to achieve optimum performance.
    – Matt
    Nov 29, 2011 at 11:34

1 Answer 1

1

Generally

  • DBs want as much (if not all) of their data in memory and CPU, HDD speed is less important.
  • HTTPDs want HDD I/O since files are being served from disk.

If you can specify any type of server then I see no reason why you couldn't create high spec servers and run both DB and HTTPD off the same machine, however cost aside, I think these are the main advantages and disadvantages:

Advantages

  • Load on one does not effect other
  • Can be scaled independently as need arises
  • Kernel tweaks can be applied specific to the task at hand
  • Specification of machines specific to needs (DB=RAM, HTTPD=SSD)
  • Easier to configure/manage (my opinion)
  • Easier to move to CDN in future [?]
  • Isolated machines mean less is potentially compromised from a security breach

Disadvantages

  • MySQL TCP/IP vs Unix SOCKs (DB Latency)
  • Twice as many points of failure

Unsure as to where cost fits in (which is more expensive).

While not specific to splitting the servers, one thing that may be useful is to split the web content into static and dynamic content to reduce the overhead on processing static content (no need to load PHP if you are just sending a static file).

Personal Note: We run VMware both at a datacenter (rent some blades) and locally. I much prefer to keep the DB/HTTPD separate. We have separate DB/HTTPD VMs at the datacenter but not locally. I much prefer the former and while I have no statistics the VMs at the datacenter run on alot lower spec than our combined HTTPD/DB VMs do locally with less performance issues.

1
  • Thanks very much. This all sounds great and answers much of my questions.
    – Matt
    Nov 29, 2011 at 13:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .