Does having Drupal modules present, but not enabled have any effect on the performance of a Drupal site?

To put it another way.. Would removing disabled modules from a Drupal site have a positive affect on performance?

up vote 99 down vote accepted

Generally no it will not affect performance - except for when you are viewing your Modules selection page (admin/build/modules or admin/modules). Disabled modules are not loaded into memory and never executed.

  • 23
    That being said, disabled modules still leave behind variables and database tables so that the module can be re-enabled without data loss. If you do not plan on using a disabled module again, you should uninstall the module via admin/build/modules/uninstall in D6 or admin/modules/uninstall in D7. – Dave Reid Aug 18 '11 at 16:14
  • 1
    I guess that this can be one example of a module that add a column to the node table, drupal.org/project/quickstats so I guess that if you do not unistall the module, this will represent innecessary consumption of resources (maybe minimal?) to other modules when pull node information. – cigotete Aug 18 '11 at 16:41

Yes. It can.

Despite what the others say, there are several situations in which performance will go down.

  1. Disabled, and not properly uninstalled modules can have severe effects on performance: variables for a module are not removed and will be loaded at every pagerequest. Locales for a module (in case you use a translated site) are not removed and cause overhead on an already cumbersome database-table.
  2. Drupal uses the system table as caching to avoid lookups in the filesystem for modules. The more entries there are in that table, the slower it will be. This effect is rather small, because the system table is quite well indexed. However, cache-clears and visiting the admin pages cause this table to be rebuilt. Rebuilding the table with 200+ unused modules is about 25 times slower than with no unused modules. The amount of rebuilding of this table can be quite high in some weird situations, during development and so.

Unused modules do not use more memory other then during rebuild of the system table. Unused modules do not cause more or slower lookups on your filesystem, other then during rebuilding the system table. If you go above the X-thousands of modules, then the filesystem itself can cause trouble.

  • 5
    Disabled modules are not necessarily not properly uninstalled modules: I could disable a module to avoid its setting pages appears, and not because I want to uninstall it. For example, on Drupal.org Views UI is only enabled when somebody needs to edit a view, and it's then disabled after the view editing is done. – kiamlaluno Jun 2 '11 at 12:34
  • 2
    Additionally, if you have devel/admin_menu installed, you have a nice shortcut to 'Disable developer modules,' which disables things like Views UI, Rules UI, Field UI, etc. that are not needed for normally-running production sites. This can save a few MB in each PHP/Apache thread on a normal LAMP machine! – geerlingguy Jun 3 '11 at 2:38
  • 5
    I am aware that a not enabled module is not per-sé a module-that-once-was-disabled. Your example of views and devel-alike modules does prove my point: when you disable views-ui your locale table and your varaibles table is /littered/ with lint that is loaded and evaluated on each page. I have recently cleaned up a site where we had 5MB(!) and almost 60MB(!) of leftover variables and unused locale strings, leftover from old and no-longer used modules. Causing locales lookups to become slow queries and causing 5Mb of extra memory on each pageload. – berkes Jun 3 '11 at 12:59
  • If I disable Views UI, it's because I still want to use it; it's just that I don't want it enabled when I don't need it. In that case, removing all the Drupal variables for that module would have the negative effect of resetting all the settings I changed. It's not surely what I would want. A not enabled module is a disabled module. It seems you are confusing an uninstalled module with a disabled module, where the latter is a module I disabled because I use it in specific situations, like Views UI that is really necessary when editing a view; I don't need it in other cases. – kiamlaluno Jun 16 '11 at 13:49
  • 2
    When you use views UI as you describe: disabled with the option to use it at will; it has an effect on performance. That is what the OP asks. And apparently that is how people use it (at least you do). So, the conclusion is disabled modules can have performance impact; especially if you choose to not remove them entirely; and always if they don't uninstall themselves properly – berkes Dec 28 '11 at 10:12

With installed I suppose you mean inside your drupal modules ("sites/all/modules" or "sites/yoursite.com/modules") folder, right?

If so, disabled modules won't affect performance at all, just when you visit your "admin/build/modules" page. Drupal rebuilds the cache of some module elements (as hook_menu).

From my experience, the performance decrease from disabled modules is negligible (and relative, 4000 disabled modules might make things a little slower than 30 disabled modules, etc.)

Personally, I'm just more concerned about unused (and probably outdated) code sitting in my repo and web dirs, but I'm anally retentive like that.

Technically no and yes. Normally disabled moduels don't load in memory, so they won't affect the performance of the site as such. But if the disabled modules has lot of data in variables, then it is advisable to uninstall them so that the memory gets freed up.

Removing the code of the disabled modules might not have an effect on the site.

Then again, if you installed a module at some point, it will have populated the database with a few tables. So the more modules you install, the greater the chance of affecting database performance.

Uninstalling the module will remove those unnecessary tables.

Again, performance depends on the number of modules you have installed.

The disabled modules that are not uninstalled but physically deleted from folder system would adversely impact the site performance. I had 5 such modules and due to that, there were additional 10,000 calls to is_dir() function. I used missing_modules module (missing_module) to identify the missing modules and fixed the issue in the database.

Uninstalled and disabled will not effect on performance.

But if the module is disabled only then it may have some tables associated so those are extra burden on the drupal database.

And as said earlier there will be some significant performance issue on drupal's module page. Many times this page is not loaded and takes a lot of time because of all the module those are installed/ uninstalled are displayed there.

So for overcoming this situation we should remove physically the unused modules from /sites/all/modules/ drive.

  • "Uninstalled and disabled will not effect on performance." - in specific cases they can. Especially performance of admin actions. Not only "modules" page, some modules for translation or code review work on modules not enabled too. And there are minor things like filesystem performance. – Mołot Aug 1 '14 at 11:23

Disabled modules do not affect the performance of drupal site.

But it is recommended not to download the modules which would be of no use to your site.

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.