S
S
Sergey Korenevsky2018-04-07 06:03:40
PHP
Sergey Korenevsky, 2018-04-07 06:03:40

How to save query hits for MySQL per time interval?

Dear GURU. I use CMS Joomla and a self-written component for this CMS. Everything is fine, but it happens that the server crashes when loading and gives an error (it crashes every 3 times)

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /home/u/user1/joomla-site.ru/public_html/libraries/joomla/database/driver/mysqli.php on line 876

The file with the error is the CMS library that is responsible for queries to the database.
But here's the problem: when I turn on the debug mode to view queries to the database, then in the case when the site load does NOT fall, it can be seen that everything is in order with queries to the database. But when the download FALLS, it is no longer possible to see what the site requests were, since the CMS has fallen.
I will also say that everything is in order with hosting, I have more than 30 sites on this hosting with different traffic and everything works in the best possible way. But running my component kills the load.
The component is quite complex in structure and it is not possible to know in advance which requests it will execute at what moment.
Does MySQL have a mode to save queries for a time interval?
something like log

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis, 2018-04-07
@sidni

https://ruhighload.com/How+to+enable+slow+log+in+mysql%3F

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question