Welcome to the JaguarPC Community
JaguarPC
Sales: (888) 338-5261
Support: (888)-551-3050
Results 1 to 4 of 4

This is a discussion on Remote MySQL access delay? in the Shared & Semi-Dedicated forum
I have a php script on another web host which uses mysql_connect() to connect to my database hosted here. My server here uses a static ...

  1. #1
    JPC Member
    Join Date
    May 2008
    Posts
    2

    Remote MySQL access delay?

    I have a php script on another web host which uses mysql_connect() to connect to my database hosted here. My server here uses a static IP rather than a domain, I use the static IP as the host for the connect call.

    The problem is, the connect call always takes around 20 seconds to connect, which is quite a long delay for the script I'm running. I've tried it from another web server with the same result, exactly 20 seconds to connect.

    Could it be a delay resolving the IP? Any ideas how to solve this?

  2. #2
    Ron
    Ron is offline
    Loyal Client
    Join Date
    Aug 2002
    Posts
    7,307
    Here are just a quick nudge or two without being able to put my hands on it.

    1) Sounds like there may be an rDNS issue going on? How did you specify allowed hosts, by name or IP? Log into your db server here and do some WGETs and see if they take a long time to execute. If they do open a ticket with support about it.

    2) Even though you are specifying IP addy, do the same on your own server. Try to access you server here, perhaps a quick HTML page.

    3) Check to ensure that the database isn't running slowly. log in through CLI and run some queries.

    4) Try the remote script right here locally on the db server.

    Does this happen every single time?

    Good luck!
    Good luck

  3. #3
    JPC Member
    Join Date
    May 2008
    Posts
    2
    Quote Originally Posted by Ron View Post
    Here are just a quick nudge or two without being able to put my hands on it.

    1) Sounds like there may be an rDNS issue going on? How did you specify allowed hosts, by name or IP? Log into your db server here and do some WGETs and see if they take a long time to execute. If they do open a ticket with support about it.

    2) Even though you are specifying IP addy, do the same on your own server. Try to access you server here, perhaps a quick HTML page.

    3) Check to ensure that the database isn't running slowly. log in through CLI and run some queries.

    4) Try the remote script right here locally on the db server.

    Does this happen every single time?

    Good luck!
    Hi Ron, thanks for the reply.

    1. The allowed hosts are specified by IP, but I've also put in the domain. I'm not sure what you mean by doing some WGETs. When requesting just a normal html page using the dedicated IP, there is no delay.

    2/4. When I connect using localhost or the shared IP and run the script on this server, connection is instant. When I use the dedicated IP, even from this server, it takes exactly 20 seconds to connect each time.

    3. The database itself is running fine, queries are fast.

    Edit: The problem has just stopped. I was re-running the tests, and there is now no delay... No idea what caused or fixed it, but thanks for the help! (:
    Last edited by clockwork; 05-02-2008 at 04:56 PM. Reason: Fixed

  4. #4
    Ron
    Ron is offline
    Loyal Client
    Join Date
    Aug 2002
    Posts
    7,307
    I'm glad it started working for you.

    I think that 20 seconds is the key. I'm virtually certain you were experiencing a DNS lookup issue of some sort.

    When my server was having DNS lookup issues it took exactly 20 seconds to resolve www.google.com. If I recall, it took almost exactly 20 seconds to perform a login function of some sort too.

    I don't know for sure, of course it could be something specific to the MySQL authentication process. Next time it happens, play around with removing the nmemonic host from your allowed MySQL access, check on your other server that it can resolve a random obscure site's IP address through a DNS lookup and do the same on the db server here.
    Good luck

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •