I have a Drupal System which is running fine in production and locally but the dev/cons Db seems to have a problem. After looking a bit deeper into it I found that menu_tree_check_access takes 3.8 Sec to finish!

First I thougt there must be something wrong with the DB-Server but everything is fine there.

After I started a node permissions rebuild everything was suddenly quick again. But after the node permissions rebuild finished it was slow again. So I guess there has been added some strange test content that creates some kind of infinite loop or something else.

Any ideas how to debug this? How can I run the slow query against another fresh DB from Prod e.g. with devel I only see the query with placeholders.

  • If you have access to administer the DB, start here: dev.mysql.com/doc/refman/5.5/en/slow-query-log.html and then it'll be clearer if it's a slow DB query or a PHP-related issue. – Alfred Armstrong Aug 15 '18 at 15:14
  • Do you know use xdebug? Let break poin at line 1498 in file includes/menu.inc. Check how many items in array $node_links. I thing it's big number. – Jonh Aug 15 '18 at 15:46
  • @Jonh yes I do know xdebug and will have a look after it. – macbert Aug 15 '18 at 15:53
  • Checked the slow query log as you said @AlfredArmstrong and run the query by hand again the bad and a good db - speed was okay at both but couldn't run the subquery which might be the problem. – macbert Aug 15 '18 at 15:53
  • @macbert How about debug? Did you find anything? – Jonh Aug 16 '18 at 15:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.