Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 169989

Summary: net-www/apache: high cpu load when listing directory with many subdirs and AddDirectoryIndex is used
Product: Gentoo Linux Reporter: Frank Meier <frank_meier>
Component: Current packagesAssignee: Gentoo Linux bug wranglers <bug-wranglers>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: script to create 1000 directories

Description Frank Meier 2007-03-08 18:40:02 UTC
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
Comment 1 Frank Meier 2007-03-08 18:45:18 UTC
Created attachment 112600 [details]
script to create 1000 directories

added script to generate 1000 directories in the calling folder
Comment 2 Jakub Moc (RETIRED) gentoo-dev 2007-03-08 20:21:24 UTC

*** This bug has been marked as a duplicate of bug 139451 ***