I've a directory with 1000 subdirectory which will be accessed through apache (mod_autoindex). When I access the direcory http://localhost/test/ nothing happens for about 60 seconds and the apache2 process needs 100% cpu. Now I tried different configuration changes. When I deactivated php (in /etc/conf.d/apache2)everything worked fast. Then I found out if I replace the directive AddDirectoryIndex in /etc/apache2/modules.d/70_mod_php5.conf with DirectoryIndex everything worked fine also. I tried the AddDirectoryIndex also in http.conf and it seems if this directive is used the described problem happens. Funny thing is if I put 1000 files in there instead of directories it's always fast. I found out that the AddDirectoryIndex directive is a patch included by Gentoo and is not standard in apache. That's why I post here. (http://www.gentoo.org/doc/en/apache-developer.xml) I reproduced this on three gentoo machines 2 x86 1 amd64, with apache-2.0.58-r2 and apache-2.2.4.ebuild. Reproducible: Always Steps to Reproduce: 1.generate directory in /var/www/var/www/localhost/htdocs with 1000 subdirectories 2.check if AddDirectoryIndex is used somewhere in apache config 3.access the directory throuh your browser and watch cpu load Actual Results: directory listing appears in about 60s. apache process uses 100%cpu for this time Expected Results: directory lists immediatly
Created attachment 112600 [details] script to create 1000 directories added script to generate 1000 directories in the calling folder
*** This bug has been marked as a duplicate of bug 139451 ***