Shutdown hook for deleting transients causing excessive MySQL usage
-
The shutdown hook is being used to clear expired transients. This can cause excessive PHP and MySQL usage resulting in extreme slowness to the site. We don’t know why this caused this specific issue on the site at the time it did, but it revealed a process that probably shouldn’t be being used. Why is shutdown being used rather than cron for clearing transients?
Shutdown is typically used for error handling, not for twice daily tasks like cleaning up transients.
We de-activated TEC to get the site back up functional.
https://www.evernote.com/l/ABT_fdVpW6dLxb2mmQ5LPTn94BWXfad1PVc – this shows spike on the server caused by shutdown function
https://www.evernote.com/l/ABQ7kAGFIEBCnr-MsaHVmlVxlPKpBG8ngLU – this shows PHP error on server related to the shutdown function to clear the transients.
Questions:
1) Why are transients being cleared using shutdown function rather than cron?
2) More specifically, what is this doing and what would trigger it to cause issues on a site? Might not be possible to answer this. And, regardless of what triggered this to be a noticeable problem on this site is less relevant than the fact the shutdown hook is not ideal for this purpose and opens up a lot of potential problems.
- The topic ‘Shutdown hook for deleting transients causing excessive MySQL usage’ is closed to new replies.