php - Database write operation delayed for several minutes before inserting data
phpcn_u1582
phpcn_u1582 2017-05-16 13:02:48
0
1
429

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. . . .

phpcn_u1582
phpcn_u1582

reply all(1)
迷茫

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template