Admin Menu module: Popular yet occasionally problematic

We encounter this problem a lot: the extremely popular and oft-used Admin Menu module causes performance problems.

Here is an example from a site we recently did a Drupal performance assessment for.

Executed 3,169 queries in 584.11 milliseconds.
Page execution time was 4,330.86 ms.

As you can see, the number of queries per request is horrendous, and the site is a resource hog if left in that state.

There were several reasons that were causing excessive number of queries leading to excessive page load time, and general slowness and resource usage.

The key here is that the context module was doing a cache_set() and that was triggering Admin Menu to rebuild its menus.

We diagnosed the problem, and were able to get over it by disabling the following modules:

  • ND Context
  • Context Layout
  • Context UI
  • Context
  • Admin Menu

After disabling the above modules, we were able to get much better response and far less queries, after we did that, as follows:

Executed 245 queries in 59.41 milliseconds.
Page execution time was 866.24 ms.

Orders of magnitude better ...

We are told, but have not verified, that the 3.x branch is supposed to fix some of the performance issues of Admin Menu.




Good for the diagnose, but

Good for the diagnose, but the solution is quite drastic. Shouldn't be enough to disable Context.
Any other solution?

Seen it slow ...

We've seen it slow on sites without context as well, but in this case we captured figures before/after for it.

The issue(s) probably exhibit themselves when a site has a large menu structure regardless of the underlying cause for it.

This is not quite a solution

This is not quite a solution if you intent to use Context.
Disabling admin menu isn't convienient too.

I have Admin menu, Context and Context UI enabled, and here is what Devel says : "Executed 449 queries in 420.97 ms"

May be related to this:

May be related to this:

Context UI performance improvements


I've ran into the same issues in the past. There are performance patches for context UI that help quite a lot: - Context UI Editor - menu speed up - Context UI markup with slow _get_region call run if user does not even have permission to edit

Admin menu for user 1

I generally use admin menu for user 1 only (have it enabled but give no roles the permission).

That way I can use admin menu for site building tasks but lower down admins get the normal drupal toolbar.
Then I just have a little snippet of code so the regular toolbar doesn't appear for user 1.

In theory this should mean the overhead of admin menu is not experienced by regular users (I assume admin menu wouldn't be doing anything without perms, but have not actually investigated), who usually don't need to complexity of admin menu (and don't have access to most of what it holds).

This is only an issue for

This is only an issue for authenticated users who have permission to see the administration menu, right?


The site had only one user who was creating content and the site was very slow for her, and a resource hog as well for the server. Once we removed those modules, everything was fast.

How do you diagnose these memory issues

Hi thanks for the sharing.
Can you please tell me which tools or software do you use in testing or memory or how do you perform it.

Devel module is used

Generally to diagnose memory issues Devel module is used

Could it be this

Could it be this issue?


Context module not very performant anyway

The context module isnt very performant when you have a large sets of contexts. It has to loop through all its context to see if anything has to be triggered. Better is page manager which just reacts to the path and has a far powerful context system.