Remote MySQL latency very high

Gareth-AWD

Well-Known Member
Jul 3, 2008
195
13
68
London, UK
cPanel Access Level
Root Administrator
Having severe delay when connecting to cPanel MySQL using remote SQL.

I had this problem a couple of years ago and decided it must have been my legacy scripts causing the issue. I've since rewritten my connection scripts using PDO and the problem still remains across all my cPanel servers.

If I run my new development on the cPanel server running localhost I get a total executive time of 8ms which is very fast.

If I run on my local machine but set to the IP of my server the total script execution time is 600ms.

It can't be anything local on my Wamp as on my Mac with MacOS's native install of PHP it does exactly the same thing.

Is there any way to speed up the connection? I disabled the firewall too so no issues from that.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,884
2,243
463
Hello @Gareth-AWD,

The type of issue you described typically relates to the connection between the cPanel server and the remote server. For instance, have you tried running the "traceroute" command from your local server to the cPanel server to see the results? How far away are the two servers geographically?

Thank you.
 

Gareth-AWD

Well-Known Member
Jul 3, 2008
195
13
68
London, UK
cPanel Access Level
Root Administrator
Thanks for the feedback. I appreciate I'm using non server based broadband to connect but thought 600-1000ms was high. I tried two locations with similar results and we're about 100 miles away from where the server is.

General delay of pinging the server is about 80-100ms. It seems to just be when connecting to MySQL is the issue.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,884
2,243
463