Does anyone know whether the performance of Drupal is slowed by having a MySQL server not on localhost , but on a different computer, e.q. webserver on 159.127.43.33, mysql server on 159.127.43.01.

My website runs very slow, and I believe it's got something to do with the connection to the database.

Comments

bertboerland’s picture

though this isnt a common setup yet within the drupal community, a tier-ed infra layout is used a lot on bigger sites and I for one am very interesting in this setup and your problems.

I quess you did some basic troubleshooting?

Network delay between webserver and database server? (async routing, MTU sizes, RRT etc)
Mysql from webserver reaction times?
lynx from webserver to localhost reaction times?
network client to webserver ?

etc

--
groets
bertb

--
groets
bert boerland

luigi-1’s picture

eh, i'm not a webwizard, so i don't really know what your talking about, sounds interesting, though.
Can you tell me how to do these things?

If you're really interested, you can contact me at m.vdmeulen AT gmail DOT com, either by MSN or by mail. Ik ben Nederlands, dus dat maakt de communicatie vast wat makkelijker ;-) Further, the site is hosted at a provider, so I probably can't tell you everything about the configuration etc.

gr.,

luigi

ban-1’s picture

I have been running a drupal site with the mysql database on a different server and i haven't noticed any speed problems compared to a normal drupal install.

both webserver and database are on my DMZ2 and the site can only be accessed via a reverse proxy server on my DMZ1.

I do have some comments on your setup however:

it seems like you are giving a real ip (non-private) address to your mysql machine. That does not seem like a very good idea, and it is certainly not needed by drupal (your database server should only be visible from your webserver, not from the entire internet, so there is no need to give it a real ip !!)

Is it possible that all traffic from your webserver must pass via firewall or router to reach your database ? that could explain the speed problem. in my setup, webserver and database server are attached via a 100Mbit FD switch.

Ban

luigi-1’s picture

Well, i must say that it helped that the provider upgraded the computer that served the MySQL database, although reaction still can be very slow.

As for the IP-adress: i'll have to change that. Has to do with setting up my site before my domain was online.

Firewall shouldn't be a problem: I don't have one (a hardware firewall, that is), and it seems unlikely a firewall at the provider is giving problems...

killes@www.drop.org’s picture

See this comment in database.mysql.inc:


 * Note that you can change the mysql_connect() call to mysql_pconnect() if you
 * want to use persistent connections. This is not recommended on shared hosts,
 * and might require additional database/webserver tuning. It can increase
 * performance, however, when the overhead to connect to your database is high
 * (e.g. your database and web server live on different machines).

--
If you have troubles with a particular contrib project, please consider filing a support request. Thanks. And, by the way, Drupal 4.5 does not work with PHP 5.

luigi-1’s picture

well, that seems to be a promising way to go. ehm, i'm going to try out. I will report the results.