Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Will likely be serving multiple independent WordPress websites and am trying to determine the best general approach. At present I'm looking at two VPS, one with Apache/PHP/FastCGI and another running MySQL with a private interface between the two. This allows me to tune and scale the web server and database server independently, if necessary. On the other hand, it introduces some additional complexity, requires a heavier MySQL process, creates more chance of bottlenecking at the database, and probably exposes more attack surface-area.

The other approach is to put all services on one, larger VPS, and simply add resources or additional self-contained nodes as necessary.

Does anyone have specific experiences with the pros and cons of both approaches? Additional suggestions? Recommended resources?

share|improve this question
probably exposes more attack surface-area not if your mysql is only accessible within your private network. – Prix Aug 19 '10 at 2:45

In terms of scaling, it's always best practice to separate roles from each other, for both security and performance perspectives. Separate Web and DB layers are usually the first thing one does to scale. This is done so each host can be tuned specifically for the workload it performs.

One other thing to consider, when roles are separated to different hosts, the OS caches will be filled with more relevant data than if the two roles were combined. Since I/O is almost always the bottleneck in any web architecture, any time you can take advantage of extra caching is a plus.

share|improve this answer

Seperating apache and mysql is done (most relevantly) because it's a clean seperation layer (the mysql connection settings) for opening a new can of resouces. If we're talking about small slices of a VPS, you're not getting a whole new machine obviously, so it has less use there. Do make sure you keep that seperation layer (one hostname string you can easily modify/redirect, no "localhost") so you can seperate the later on.

If you're autoscaling and potentially taking up a whole physical beast, then go for seperate machines. Do verify the network latency between the two, it could be bad if your apache and mysql are more than a few milliseconds from each other (IE, different datacenter). Preferably discuss this in advance with your provider and get something akin to a private network.

Your VPS provider may also allocate disproportionate resources/services for bigger packages. This can be a reason to put everything together.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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