search

Home  >  Q&A  >  body text

php - Database write operation delayed for several minutes before inserting data

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_u1582phpcn_u15822828 days ago447

reply all(1)I'll reply

  • 迷茫

    迷茫2017-05-16 13:04:48

    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

    reply
    0
  • Cancelreply