4

I currently have 2 Debian servers (VPS with 4 GB memory) and am hosting a variety of websites of differing importance: some are production sites, while others are demo/staging/test sites. Approximately 15-20 websites, one of which will have a fair amount of traffic soon.

For the moment, I have my production sites deployed on one server and demo/staging/test sites on another. Both servers run Apache and MySQL.

I have read about and understand most of the benefits of separating the database (MySQL) from the web server (Apache, but probably going to switch to nginx). I have no performance problems at the moment, but need to move things around from one server to another and was wondering if it was a good time to reorganise the data on both servers. For the moment I do not have the money to add extra servers in the mix.

My question: Is it better to put all my websites on one of the two servers and their corresponding databases on the other, given that they are split between production and demo/staging/test applications, or would I be better off keeping the separation between production and non production applications (considering security/performance factors)?

Ideally, I would move all non production applications to a third server but for the moment its a no go.

0

Personally I would be inclined to leave the installation as it is. (1 Production server & 1 Testing/demo/staging server). I can't see any advantages by changing it. And I don't see any disadvantages in leaving it untouched. You plan a third server which will force you to change the installation anyway. If DB performance is a concern, think about clustering MySQL on both servers. A simple master / slave setup work do the trick. That way you can use one or both node(s) for all select queries & the other for all edit (insert, update, etc.) queries. That way dividing the load.

2

Although an answer has been accepted here, I strongly disgaree that it's the right way to go.

Unless you have complex deployment and/or capacity testing requirements, then why are you paying for a server to host your non-production stuff? All you need is a local VM (it's trivial to implement bandwadth, latency and packet loss on a proxy).

Even VPs go down. If you want high availability then both systems should be symmetrical. Suppose you have a probability of failure of a node at 0.01%. Then the probability of losing your service as it stands is 0.01%. Split the service vertically (http and mysql) then your probability of a complete loss of service is 0.01+0.01% - double what it was. OTOH with a symmetrical config the probability of a complete loss of service is 0.01%*0.01% = 0.0000001% and you get the benefits of more performance and more capacity and an easy way to implement A/B testing.

How you implement mysql clustering and balancing of traffic is a more complex question - but can be done without adding extra software/hardware.

  • Hello symcbean. Interesting point. You obviously know your stuff. Thanks for the comment. – Eamonn Travers Jan 13 '15 at 9:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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