2

We have a standard LAMP-stack web application running on a dedicated server at hosting company A.

After some analysis we have decided that we need to put the MySQL database and various background jobs that crunch data on it on a separate server, in the hopes that leaving the web app to run only PHP will speed up the entire system.

We are getting good prices for a dedicated server at hosting company B, much better than at company A.

So my question is whether it is feasible to put MySQL at hosting company B. This means of course that MySQL queries and results need to traverse the Internet. I'm more concerned with latency than with bandwidth. Is this feasible at all? Both the companies have good internet connectivity and speed, independently considered.

Generally with this situation we have only had the Application and Database servers within the same hosting datacenter, if not the same LAN, but I'm wondering if this is still necessary.

1
  • Just FYI, we did try this, and while the new server was very fast, and the connection between old and new server was very fast (we could get sustained 80Mbps transfer rates on files of 1TB+ size), the web application performed slowly. It actually worked but was too slow to be useful, so presumably latency is, as expected, a killer.
    – royappa
    Aug 15, 2013 at 20:41

2 Answers 2

3

It is certainly possible. But depending on various factors, the latency introduced by the network connections may produce a larger bottleneck than what you're seeing on the single server now. As you stated, it's most ideal to keep your db server on the same LAN. You'd need to know more about your traffic and server loads to really analyze this without just trying it to see.

3
  • Thanks. I'd love to hear from anyone who has actually done this in a production environment (if you have done this, or anyone else).
    – royappa
    Jul 30, 2013 at 22:19
  • yes i've done this in a production environment with the web server hosted remotely to the mysql server, for very lightweight applications (eg only one query per page load). How well it will work is a function of how heavily trafficked your sites are X how many db calls per action are built into your pages. I wouldn't try it with a trafficked drupal site. Jul 31, 2013 at 0:12
  • The app is for internal users only (about 50), so high load is not an issue. It just crunches a lot of data in MySQL with background jobs, which I suspect makes the web app (which mainly reads from the DB) slow. So thank for this feedback, I will try it in a limited way and see how it works!
    – royappa
    Jul 31, 2013 at 11:56
3

Before you separate your MYSQL database to other server I highly recommend to try using SSD hard disks in the same server. These high speed hard disk will provide you with a higher speed system. Also it is cheaper than leasing new dedicated server for only databases.

You must log in to answer this question.

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