Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Slow remote connection (on broadband only)

0 views
Skip to first unread message

Kevin Edwards

unread,
Sep 8, 2010, 4:03:58 AM9/8/10
to
I connect, from work and home, to a remote MySQL database hosted by
JustHost, using dedicated software through port 3306.

Just recently, every connection from home takes about 15 seconds,
although the connection from work is still immediate. Once connected,
queries are returned immediately, it is just connecting that is affected.

JustHost have decided after investigation that 'their end' is fine, and
I suppose this is borne out by good connection from work and from the
following...

As a test, I disconnected my broadband service at home and tried to
connect through a dial-up service. Surprisingly, connection was good and
fast (even accounting for dial-up), so it would seem that my broadband
service (which is otherwise good) is slowing down connection. it seems
to be always about a 15 second delay.

I have emailed my broadband service provider about this but not heard
back yet. Just wondered if anyone can throw any suggestions my way about
this.

Kevin

Gordon Burditt

unread,
Sep 8, 2010, 11:50:35 AM9/8/10
to
>I connect, from work and home, to a remote MySQL database hosted by
>JustHost, using dedicated software through port 3306.
>
>Just recently, every connection from home takes about 15 seconds,
>although the connection from work is still immediate. Once connected,
>queries are returned immediately, it is just connecting that is affected.
>
>JustHost have decided after investigation that 'their end' is fine, and
>I suppose this is borne out by good connection from work and from the
>following...
>
>As a test, I disconnected my broadband service at home and tried to
>connect through a dial-up service. Surprisingly, connection was good and
>fast (even accounting for dial-up), so it would seem that my broadband
>service (which is otherwise good) is slowing down connection. it seems
>to be always about a 15 second delay.

Consider the possibility that the IP address you get from the
broadband service has no reverse DNS or the DNS servers are
misconfigured. The MySQL server attempts to get the reverse DNS
of the client. I suspect it times out attempting to do so. This
isn't a fatal error, so the connection eventually proceeds. It
could fail with an access denied error if you are only allowed
access from specific domains, but I don't think this is the case
here.

In the situation you describe, your dialup service does it right.

The server can avoid looking up reverse DNS by starting the MySQL
server with --skip-name-resolve . This may require significant
re-doing of the privilege tables, as you can no longer use host
names in privilege tables. Don't be surprised if your (MySQL)
hosting service refuses to do this, especially if you share the
MySQL database with other customers (as opposed to leasing an entire
server for yourself only).


>I have emailed my broadband service provider about this but not heard
>back yet. Just wondered if anyone can throw any suggestions my way about
>this.

A way to test this from FreeBSD or Linux is to run:
dig -x IP_address_of_the_client
and for a true test, you have to run this from the server.
Otherwise, if the IP address is A.B.C.D, look up the name
D.C.B.A.in-addr.arpa
using whatever DNS tools you've got. That's the IP address of
the *client*, not that of the MySQL server, you should use for
the test.

Time how long it takes to get a result. However, the problem is
often visible if you run it from any internet-connected host, using
the IP address your client had at one time. Compare the results
from a dialup IP vs. a broadband IP.

If the broadband IP takes 15 seconds to look up, they have the
problem. Good luck getting them to fix it. MySQL isn't the only
service that looks up the host name of an incoming connection. SMTP
and POP servers might, also (but your broadband provider probably
has it turned off on the SMTP and POP servers you are told to use).
Web servers typically don't. If you can complain that a service
*they* provide is taking 15 seconds, you have a better chance of
getting it fixed.

Kevin Edwards

unread,
Sep 8, 2010, 4:59:15 PM9/8/10
to
On 08/09/2010 16:50, Gordon Burditt wrote:

>> Just recently, every connection from home takes about 15 seconds,
>> although the connection from work is still immediate. Once connected,
>> queries are returned immediately, it is just connecting that is affected.

> Consider the possibility that the IP address you get from the


> broadband service has no reverse DNS or the DNS servers are
> misconfigured. The MySQL server attempts to get the reverse DNS
> of the client. I suspect it times out attempting to do so. This
> isn't a fatal error, so the connection eventually proceeds. It
> could fail with an access denied error if you are only allowed
> access from specific domains, but I don't think this is the case
> here.
>

That's interesting. I used to have a static ip until a few months ago.
This was very helpful because, as you say, the database needs to know
from which ip addresses it should accept requests, and mine and work's
were the only two set. I have now lost the static ip facility and only
the first two numbers remain static, so I have to set the acceptance to
real.real.<wild card>.<wildcard>

Although I didn't mention it in the first post, the connection problem
is intermittent - some days bad, some days good, and at the moment it is
good. I have just done a Reverse DNS lookup of the current ip address
and got a satisfactory link back to my provider. I have started making a
note of my ip addresses as they change to see if the presence or absence
of problem is linked to different ip addresses. If it is I can throw
this data at my ISP.


> The server can avoid looking up reverse DNS by starting the MySQL

> server with --skip-name-resolve . Don't be surprised if your (MySQL)


> hosting service refuses to do this,

As they cannot re-establish static ip after months of badgering, I
wouldn't even try!


> If the broadband IP takes 15 seconds to look up, they have the
> problem. Good luck getting them to fix it. MySQL isn't the only
> service that looks up the host name of an incoming connection. SMTP
> and POP servers might, also (but your broadband provider probably
> has it turned off on the SMTP and POP servers you are told to use).
> Web servers typically don't. If you can complain that a service
> *they* provide is taking 15 seconds, you have a better chance of
> getting it fixed.

Not sure what you mean here. For different purposes, the same database
is also accessed by PHP files on the host's server, and connection to
the database via HTTP and PHP is always ok, so there is no hope of
complaining that the web server is playing up.

Thanks for your help. You have made me think about the dynamic ip
address as a possible cause, or at least a new way of monitoring the
problem.

Kevin

Gordon Burditt

unread,
Sep 9, 2010, 5:45:06 AM9/9/10
to
>Although I didn't mention it in the first post, the connection problem
>is intermittent - some days bad, some days good, and at the moment it is
>good. I have just done a Reverse DNS lookup of the current ip address
>and got a satisfactory link back to my provider. I have started making a
>note of my ip addresses as they change to see if the presence or absence
>of problem is linked to different ip addresses. If it is I can throw
>this data at my ISP.

It's possible for only *some* IP addresses to have the reverse DNS
problem, although usually IP addresses in the same block will have
the same status.

>> The server can avoid looking up reverse DNS by starting the MySQL
>> server with --skip-name-resolve . Don't be surprised if your (MySQL)
>> hosting service refuses to do this,
>
>As they cannot re-establish static ip after months of badgering, I
>wouldn't even try!
>
>
>> If the broadband IP takes 15 seconds to look up, they have the
>> problem. Good luck getting them to fix it. MySQL isn't the only
>> service that looks up the host name of an incoming connection. SMTP
>> and POP servers might, also (but your broadband provider probably
>> has it turned off on the SMTP and POP servers you are told to use).
>> Web servers typically don't. If you can complain that a service
>> *they* provide is taking 15 seconds, you have a better chance of
>> getting it fixed.
>
>Not sure what you mean here. For different purposes, the same database
>is also accessed by PHP files on the host's server, and connection to
>the database via HTTP and PHP is always ok, so there is no hope of
>complaining that the web server is playing up.

As I understand it, you have *three* *different* providers here:
dialup, broadband, and database hosting. Do you know what
finger-pointing is? ("It's the other guy's fault") If you can
find a service offered by the broadband provider that doesn't work
right (e.g. mail service) because of the broadband provider's broken
reverse DNS, there's no way he can claim it's the database host's
fault, because all of the services involved are his.

>Thanks for your help. You have made me think about the dynamic ip
>address as a possible cause, or at least a new way of monitoring the
>problem.

A static IP can have the same problem (but it won't be intermittent).
It tends to get fixed because the problem is there all the time.
The first time I ran into this problem I was working for an ISP and
the DSL line involved was that of the CEO. He was testing DSL
before we started offering it.


Kevin Edwards

unread,
Sep 10, 2010, 3:42:31 AM9/10/10
to
On 09/09/2010 10:45, Gordon Burditt wrote:

>> Thanks for your help. You have made me think about the dynamic ip
>> address as a possible cause, or at least a new way of monitoring the
>> problem.
>
> A static IP can have the same problem (but it won't be intermittent).
> It tends to get fixed because the problem is there all the time.
> The first time I ran into this problem I was working for an ISP and
> the DSL line involved was that of the CEO. He was testing DSL
> before we started offering it.

The IP address seems almost certain to be the problem, based on my
findings so far (rebooting the router to get a new IP address).
I have a list of address that cause the problem and a list of 'good'
addresses. My ISP has supported the monitoring of this and agreed to
establish a static IP address again.

Thanks for your help and suggestions.
Kevin

0 new messages