Remote MySQL slow?


#1

Hey all,

I wanted to use the same database for for both my local copy and the online copy of my site, so I’m trying out the remote database option. I can connect and access everything, but it is incredible slow. It takes anywhere from 10-25 seconds just do load a very simple page that interacts with the database.

Is this normal?


#2

Not one person here uses remote mysql and can tell me if this is normal or not?

/sad panda


#3

I use it all the time but not like you’re using it. I normally don’t use the same database as a live server/website for my testing domain…

I remote in using MySQL Workbench if I need to run some update queries or something but that’s about it.

From what you are doing it could be your ISP connection, what’s ping say? How about tracert?

Rule of thumb, from what I’ve read, is remote is ~4 times your connection latency.

Jw


#4

depends on how many queries are going on. As jwwicks said, if you are running a query, the lag is not too bad, but if you try to load a WP page locally using DH’s sql server, there could easily be a 10s delay or more. I tried using C5 to update the live DB on DH and found it painfully slow.


#5

I connect with both MySQL Workbench and Eclipse and the queries across the net are in the 2ms range so nearly instant. 10s huh, were these large updates?

Jw


#6

How far are you physically from DH? I’m in the S. Hemisphere, so even pinging is on the order of 100+ ms minimum.

The 10s i was referring to is simply the normal range of queries that WP and the like does each time a page is rendered, on the order of 20-40 queries per page IIRC.


#7

I guess you could say I’m right up the street from them. They are in Los Angeles,Ca and I’m in Sacramento,Ca

Yeah ping of my primary webserver is about 23ms. Ping of the mysql host is about 40ms. A simple select off the mysql host took far less than ping ~20ms according to Eclipse. Interesting that previous result was even less.

Haven’t tried bench marking what the OP is doing. Maybe I’ll try that next weekend :slight_smile:

Jw


#8

yeah, in terms of the speed of light & response times, that’s almost next door. Nevertheless, I’ll look into it further sometime. I only recently realised that MySQL Workbench can connect to a database over SSH rather than having to go through an SSH tunnel that I manually initiate, so it might be one of my settings is not optimum. But there’s still going to be a 150ms or so delay just due to distance, and that adds up after a short time.