I am running a laravel application that is on a separate server than my MySQL database.
If I run the query on the Mysql server it takes the expected 0.00 - 0.01 seconds to return. However when I log the time from the start of a query to the end it takes .3secs. The whole API call takes between 800-1000ms.
I have changed my.cnf to skip-name-resolve, I have query cache turned on, I am using the IP and not the domain name for the connection.
I am not sure what else to try. This is a very simple RestAPI with simple queries and nothing complicated, and the largest table in the database has 9000 rows. I don't think it's a database issue, but a connection issue.
The CPU is only ever using 1%, and there is plenty of memory.
Any tricks I am missing?