Hi!
I'm having trouble with a very slow drupal install and after enabling the query log on the bottom of the page, I noticed that on every page there is a slow query:
_menu_router_save
DELETE FROM menu_router

Followed by a large number of insert queries:
INSERT INTO menu_router (path, load_functions, to_arg_functions, access_callback, access_arguments, page_callback, page_arguments, delivery_callback, fit, number_parts, context, tab_parent, tab_root, title, title_callback, title_arguments, theme_callback, theme_arguments, type, description, position, weight, include_file) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9, [truncated]
[see more in pdf attachment]
Is this normal behaviour or could this be the cause of the slowness of the site/theme?
| Comment | File | Size | Author |
|---|---|---|---|
| output.pdf | 3.94 MB | flbr | |
| meunerg.jpg | 13.2 KB | flbr |
Comments
Comment #1
David_Rothstein commentedDefinitely not normal behavior - menu rebuilds should only happen very rarely (immediately after the site's caches have been cleared, for example). If it's happening on every page request it's almost certainly the main reason the site is slow, since menu rebuilds are very expensive operations.
I am not sure what would cause that exactly, but http://drupal.stackexchange.com/questions/86591/why-is-my-menu-router-be... has some suggestions to try...
Comment #2
flbr commentedThanks David!
Following that thread, I placed "print variable_get('menu_rebuild_needed')" in the template and found out that variable_get('menu_rebuild_needed') always returns TRUE. Now the question: how to find the cause of this? In the thread on stackexchange it mentions a "null title in its hook_menu", but I don't know how to look for that. Any directions?
Thanks!
Comment #3
David_Rothstein commentedSorry for the delay in responding. If this is still an issue, I would suggest checking the site's logs (at
admin/reports/dblogif using the core Database Logging module). Some kind of error along the lines of the PDOException referred to in that StackExchange post is likely, and this should show up as an error in the logs (frequently, if it's occurring on every page request). Hopefully being able to see that error message would provide more useful debugging information as to what's causing this.Comment #4
flbr commentedThanks for your reply! We found out that our code to write a custom pager didn't work correctly. When we removed it, the menu_router was rebuilt only once.