I have a new VPS server, and I'm trying to connect it to another server from the same provider. When I connect via mysql command line tool, the connection is very fast.
When I use PHP to connect to a remote database, the connection time can take up to 5 seconds. Requests are then completed quickly.
This is not limited to mysql, using file_get_contents () to download a file from any other server gives the same lag. Using wget to get the file does not have this lag.
I have configured DNS queries from PHP using dns_get_record () and they are fast (1-2 milliseconds).
Any thoughts on what in php config might trigger this?
Thank.
source
share