I have nginx web server running newest WordPress and DB server running MySQL 5.6 There is around 90-100ms latency(round-trip delay) between those 2 servers.
The problem is that It takes about 5000 ms to get response from my web-server if I access DB remotely.(The connection is encrypted by SSL)
In comparison it takes about 200 ms if I access MySQL locally(web-server & MySQL installed on one single machine).
1. Why is that ? Is it because WP has multiple MySQL queries per page and waits for each and every one to complete ? Therefore it adds up : 100+100+100+100..=5000ms ?
2. Can WP be modified to request from MySQL asynchronously, in order to reduce waiting time for request to be successful?
Thank you. :)