1

What are the performance implications of having a web server (apache/php) and a database server (mysql) in completely different locations with different hosts.

Edit: Its a database intensive web application so every page makes multiple trips to the database. The database is normally the bottle neck in web applications, just wondering if the network speed is significant when compared to the typical speed of database interactions.

2
  • You're going to have to be more specific. It's obviously going to have a negative impact. Jul 8, 2009 at 14:40
  • 1
    Some other useful information to have; Ping time between hosts, basic configuration, more information on 'multiple trips' and if these different locations/hosts are in the same lan/wan or across the internet. Yes, network speed is significant to database transactions but it also depends on the speed. 100mbit to 1000gbit isn't as significant to a mildly used database as 1mbit to 6mbit.
    – drgncabe
    Jul 8, 2009 at 15:42

5 Answers 5

5

This is highly dependent on the connection speed between the two locations. Some companies have high speed backbones between their data centers but from the sounds of it you are looking at two different companies. Since the connection is going across the internet and lines outside the control of either company then there is no solid answer to this question.

I would avoid it if at all possible. If you really feel this is the best approach look into something like memcache to alleviate querying from the DB.

4

What are the performance implications of having a web server (apache/php) and a database server (mysql) in completely different locations with different hosts.

Yes, there are performance implications, and they are all negative. Such a system could work, especially if the two systems are connected by a VPN with a Service Level Agreement based on both uptime and performance. If you are just going through "the cloud", you will have no consistency of network performance, and no one-throat-to-choke if connectivity or performance goes down.

just wondering if the network speed is significant when compared to the typical speed of database interactions.

That would be totally dependent on your network speed and your database and application.

There are two network performance aspects to consider- latency and throughput. You need to consider both.

For example, users will often be patient (up to a point) in waiting for a search query. They will not be patient for each page to load as they navigate a site. While both are viewed as latency from the user perspective, the first example might be weighted by the network throughput between database and web server, while the second by the network latency.

Or not! Only testing will tell.

2

What kinds of queries are you doing?

If you are making complex queries where the speed of the CPU is your limiting factor, perhaps having a sub 10mb/s connection to the database and high latency will not be so noticable. (but these would need to either be very complex queries, or on a very underpowered machine)

However, you may be able to speed things up by doing cacheing on the webserver machine, or by setting up a small mysql replication server local to the webserver that holds copies of any heavily-accessed data.

While having your entire database remotely located will have negative implications on your performance, having it co-located in 2 locations definitely has beneficial implications from a disaster-recovery point-of-view.

2
  • Its primarily a CRUD type business app so it'll be a regular stream of simple queries, thanks for your answer, clarified things for me nicely.
    – user12077
    Jul 9, 2009 at 9:09
  • 1
    Local replication is probably the solution for you. If you are able to modify you application to segregate reads (keeping them local) and writes (sending them to the master), then you are in business. If you are able to do this, you should also be able to modify the app to use memcached. If you can't modify the app, then you could use MySQL Proxy to do the segregation. Jul 9, 2009 at 15:16
1

This needs more detail. There could be a lot of connection options if they are in different locations. It would be slower communication it were a slow connection and vise versa. Is there more to this question? How much active communication is taking place between the two servers?

EDIT: What are your connection options? How many users do you expect? Your "database intensive" might work for a few simultaneous users, but if your site gets many users, you are going to have one slow site. You are going to want to do a lot of load testing on that site if that is your only way to set it up.

0

What is the size of the average data requested from the database server, what is your available bandwidth between the two, and how heavily trafficked is it? It should be pretty easy to figure out if there is going to be a showstopping bottleneck.

You must log in to answer this question.

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