I am trying to find the bottleneck for an internal PHP application. I can only get around 10 req/sec before requests start taking 5 or more seconds to complete. The CPU load on the server is nothing, vmstat
does not show any I/O wait or swap. I have a strong suspicion it is the connection to an external MySQL server causing the slow down. I am using:
mysqli_real_connect(...)
Is there a way to time how long it takes to connect, and log it somewhere, so I can view how long the actual handshake and connection to the MySQL server is taking.