mySQL remote connection takes 4 secs

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
alexmaster_2004
Forum Commoner
Posts: 35
Joined: Wed Sep 14, 2005 8:44 am

mySQL remote connection takes 4 secs

Post by alexmaster_2004 »

Hi all
I have two dedicated servers. One Linux(FC5) webserver and one Windows(Server 2003) dedicated for MySQL.
The linux server hosts a big website that runs under PHP5. When i try to connect from PHP to the windows server, it takes almost 4 seconds before the connection is made. This delay is way too long for my web-application.
The connection is made on this way in PHP:

Code: Select all

mysql_connect($remote_sql_server, $db_user, $db_pass, false, 2);
Hope anyone can help.
Thanks
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Are you sure it's not a database configuration problem? To test, you could attempt a command line connection from the Linux server to the Windows one. If that takes a similar amount of time (it should be slightly faster,) then I would consider looking deeply at the configurations or possible a network connection issue such as too many collisions and/or hops between them.
Post Reply