Here is my scenario I'm trying to debug:
I'm profiling MySQL queries using PHP's microtime() function, to determine how long each query takes. I have tested it on one domain, and comparing average query times. The databases on the local and remote server are identical.
When the site uses its local database server, the query times are all in the range of 0.0002-0.0004 secs as expected. The average query times when using the remote database are 0.0695 secs. Ping time from the domain's server to the remote DB's server are on average 0.0068 secs (68ms). That would put round-trip latency around 0.0136 sec per query. Wouldn't this mean that each query on the remote server should only take around 0.014 secs on average? We are averaging around 5x slower. Keep in mind these are very simple queries with tiny result sets. Skip name resolve is turned ON in my.cnf, and I am using the remote server's IP address for connection.
What other factors could be at play here and what should I look into?
Am I right to expect faster query times than what I am getting?