Every time i run a drush command the command returns after 40s. (or more if time consuming operation like cache clean or so)

After strace the command i realized that drush is scanning my whole drupal directory. I have mounted via nfs an storage with thousands of Files which are accessed by an own module and i think there is no need for drush to scan these files on every run. Is there an option to exclude a path ?

my files are in drupal_root/sites/default/files/my_module/nodes/nid/

Greetings Robert

  • Consider changing title to one more to the point, like "How to exclude a path from drush scanning"? – Mołot Nov 16 '15 at 9:55
  • @rupat Maybe it's not scanning the folder, but loading the files? If you think it's scanning, check which modules does that. E.g. using XDebug trace logs. – kenorb Nov 16 '15 at 10:41

There might be something wrong with your module... You say there are more than a thousand files scanned but are they placed in your module's directory ?

Drush is not supposed to scan your sites/default/files folder for instance or any other data folder you might have set. As a best practice you should not place data in your module's path (obvious... isn't it ?). If you have done so, you should think about moving them somewhere else.

When executed, Drush scans all activated modules path (along with a few others such as sites/all/drush) for .drush.inc files. This is the expected behavior and that might cause your slow script execution.

  • Hi, my files are in sites/default/storage/ – rupat Nov 17 '15 at 13:51
  • "my files are in drupal_root/sites/default/files/my_module/nodes/nid/" so which files are you mentioning there ? – kartsims Nov 17 '15 at 14:12
  • yes that was my fault last one is right (sites/default/storage/) – rupat Nov 17 '15 at 14:19
  • So are there many files in your module path ? Do you have more information about where are the thousand files where Drush is looking for information ? Please edit the question – kartsims Nov 17 '15 at 15:13

After investigating the problem with a new attempt. i debugged drush and noticed that my drush version was scanning the whole data directory of my module for alias files. An corresponding bug report you can find here:


so here is what you have to do: update drush

Your Answer

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

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