Framework code
$db = new db(.....);
// Add monitoring, when the database is executed, it will automatically log
$db->attach(function ($sql,$bind){$di->dblog('Execute sql:'.$sql .$bind);})
//Insert a piece of data
$db->execute("insert into user values....")
Phenomena:
However, we found that the data should have been inserted immediately, but we found that the data was not inserted until 10 minutes later (calculated by binlog and dblog).
Question:
Is the execute function of pdo non-blocking? It stands to reason that the time printed in the log should be the real time of data insertion. Why is it actually written to the database 10 minutes later? Moreover, it occurs because the network card server is under great pressure. . . .
I don’t know what your overall business was like before inserting data. Has the database been optimized? Did other operations take up time before inserting? Has the system time been calibrated? In addition, PHP is blocked