0

At the moment we have a problem where sometimes, for no apparent reason, the CPU use of MySQL process skyrockets to 1000% usage and stays there until we manually restart the mysql service. During that time the webpage performs awfully slow.

There must be something in our shop (built in PrestaShop 1.6) that makes it skyrocket, but when don't know exactly what is it. Is there any way I can keep track of what it might be? That way we might be able to know if there's a malfunctioning module.
Maybe some way to keep a log for every SQL sentence sent and the time it was sent so I can compare it with the server load logs?

Niquify
  • 11
  • 4
  • Perhaps you can try checking for deadlocks? See here for a detailed description: https://dev.mysql.com/doc/refman/8.0/en/innodb-deadlocks.html And here is an useful answer for checking which tables are locked: https://stackoverflow.com/questions/9783636/unlocking-tables-if-thread-is-lost#15508863 – Radix Salvilines Nov 02 '18 at 12:20
  • 1
    Have you run the `mysqladmin pr -vvv` command to view the current ongoing SQL queries while the CPU churning is ongoing ? – nos Nov 02 '18 at 12:20
  • @RadixSalvilines We will keep that in mind, thank you. – Niquify Nov 02 '18 at 12:31
  • @nos We didn't, next time it happens i'll make sure to check it out. Thank you. – Niquify Nov 02 '18 at 12:32
  • The [MySQL Workbench](https://www.mysql.com/products/workbench/) tool provides a lot of insight into the health and utilization of your server. Worth using if you're having performance problems. – tadman Nov 02 '18 at 17:33

1 Answers1

0

In the config / defines.inc.php file, modify the following lines:

define('_PS_MODE_DEV_', false);

By

define('_PS_MODE_DEV_', true);

AND

define('_PS_DEBUG_PROFILING_', false);

By

define('_PS_DEBUG_PROFILING_', true);

And reload page.

Regards

ethercreation
  • 1,233
  • 1
  • 9
  • 19