mod_autoindex is hogging my CPU

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

my http server has a directory with 250+ subdirectories. There is no
index.html, so mod_autoindex does the job. A reload takes about 40
seconds on a Xeon E3110 with 3 GHz, meanwhile one core is hit with 100%
load by a process named httpd2-prefork.

That is way. too. slow. :-)

The system runs openSUSE 11.0, the RPM is apache2-2.2.8-28.8.

The relevant parts of the configuration are:

=================================================================
IndexOptions +FoldersFirst
Options None
<Directory />
	AuthDBMType DB
	AuthDBMUserFile /www/auth/userbase_dbm
	AuthzDBMType DB
	AuthDBMGroupFile /www/auth/userbase_dbm
	Require valid-user
</Directory>

DocumentRoot /www/htdocs
<Directory "/www/htdocs">
        Options +FollowSymLinks
</Directory>

<Directory "/www/htdocs/transfer">
	Options +Indexes
	Require group myadmin

	# FIXME: shall prevent users to put an index.html
	# into a subdirectory which will be displayed by
	# members of group myadmin.
	# Need to find a better way to do this.
	DirectoryIndex ..........
</Directory>
=================================================================

I attached an strace of all the things httpd2-prefork does for each
subdirectory.

I looks like a lot of the load comes from reading userbase_dbm over and
over (8 times for each subdirectory). If that's correct: is there a way
to get httpd to cache the contents of AuthDBMUserFile/AuthDBMGroupFile?

Regards,
        Robert
lstat64("/www/htdocs/transfer/levelA/levelB/user1234", {st_mode=S_IFDIR|S_ISGID|0570, st_size=4096, ...}) = 0
lstat64("/www", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat64("/www/htdocs", {st_mode=S_IFDIR|S_ISGID|0555, st_size=4096, ...}) = 0
stat64("/www/auth/userbase_dbm", {st_mode=S_IFREG|0640, st_size=49152, ...}) = 0
open("/www/auth/userbase_dbm", O_RDONLY|O_LARGEFILE) = 19
fcntl64(19, F_SETFD, FD_CLOEXEC)        = 0
read(19, "\0\0\0\0\1\0\0\0\0\0\0\0a\25\6\0\10\0\0\0\0\20\0\0\0\10\0\0\0\0\0\0"..., 512) = 512
close(19)                               = 0
open("DB_CONFIG", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
stat64("/var/tmp", 0xbfb28adc)          = -1 ENOENT (No such file or directory)
stat64("/usr/tmp", 0xbfb28adc)          = -1 ENOENT (No such file or directory)
stat64("/temp", 0xbfb28adc)             = -1 ENOENT (No such file or directory)
stat64("/tmp", {st_mode=S_IFDIR|S_ISVTX|0777, st_size=4096, ...}) = 0
time(NULL)                              = 1268410964
gettimeofday({1268410964, 209944}, NULL) = 0
open("/proc/stat", O_RDONLY)            = 19
fstat64(19, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7011000
read(19, "cpu  169949 4550 15441 34352376 "..., 1024) = 967
read(19, "", 1024)                      = 0
close(19)                               = 0
munmap(0xb7011000, 4096)                = 0
open("/www/auth/userbase_dbm", O_RDONLY|O_LARGEFILE) = 19
fcntl64(19, F_SETFD, FD_CLOEXEC)        = 0
fstat64(19, {st_mode=S_IFREG|0640, st_size=49152, ...}) = 0
pread64(19, "\0\0\0\0\1\0\0\0\0\0\0\0a\25\6\0\10\0\0\0\0\20\0\0\0\10\0\0\0\0\0\0"..., 4096, 0) = 4096
pread64(19, "\0\0\0\0\1\0\0\0\2\0\0\0\0\0\0\0\7\0\0\0^\0\350\0\0\2\367\17\354\17\343\17"..., 4096, 8192) = 4096
close(19)                               = 0
stat64("/www/auth/userbase_dbm", {st_mode=S_IFREG|0640, st_size=49152, ...}) = 0
open("/www/auth/userbase_dbm", O_RDONLY|O_LARGEFILE) = 19
fcntl64(19, F_SETFD, FD_CLOEXEC)        = 0
read(19, "\0\0\0\0\1\0\0\0\0\0\0\0a\25\6\0\10\0\0\0\0\20\0\0\0\10\0\0\0\0\0\0"..., 512) = 512
close(19)                               = 0
open("DB_CONFIG", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
stat64("/var/tmp", 0xbfb28b2c)          = -1 ENOENT (No such file or directory)
stat64("/usr/tmp", 0xbfb28b2c)          = -1 ENOENT (No such file or directory)
stat64("/temp", 0xbfb28b2c)             = -1 ENOENT (No such file or directory)
stat64("/tmp", {st_mode=S_IFDIR|S_ISVTX|0777, st_size=4096, ...}) = 0
time(NULL)                              = 1268410964
gettimeofday({1268410964, 282090}, NULL) = 0
open("/proc/stat", O_RDONLY)            = 19
fstat64(19, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7011000
read(19, "cpu  169956 4550 15441 34352384 "..., 1024) = 967
read(19, "", 1024)                      = 0
close(19)                               = 0
munmap(0xb7011000, 4096)                = 0
open("/www/auth/userbase_dbm", O_RDONLY|O_LARGEFILE) = 19
fcntl64(19, F_SETFD, FD_CLOEXEC)        = 0
fstat64(19, {st_mode=S_IFREG|0640, st_size=49152, ...}) = 0
pread64(19, "\0\0\0\0\1\0\0\0\0\0\0\0a\25\6\0\10\0\0\0\0\20\0\0\0\10\0\0\0\0\0\0"..., 4096, 0) = 4096
pread64(19, "\0\0\0\0\1\0\0\0\2\0\0\0\0\0\0\0\7\0\0\0^\0\350\0\0\2\367\17\354\17\343\17"..., 4096, 8192) = 4096
pread64(19, "\0\0\0\0\1\0\0\0\7\0\0\0\2\0\0\0\0\0\0\0N\0\"\3\0\2\367\17\252\17\241\17"..., 4096, 28672) = 4096
close(19)                               = 0
stat64("/www/htdocs/transfer/levelA/levelB/user1234/..........", 0xbfb2943c) = -1 ENOENT (No such file or directory)
lstat64("/www", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat64("/www/htdocs", {st_mode=S_IFDIR|S_ISGID|0555, st_size=4096, ...}) = 0
lstat64("/www/htdocs/transfer", {st_mode=S_IFDIR|S_ISGID|0555, st_size=4096, ...}) = 0
lstat64("/www/htdocs/transfer/levelA", {st_mode=S_IFDIR|S_ISGID|0555, st_size=4096, ...}) = 0
lstat64("/www/htdocs/transfer/levelA/levelB", {st_mode=S_IFDIR|S_ISGID|0555, st_size=4096, ...}) = 0
lstat64("/www/htdocs/transfer/levelA/levelB/user1234", {st_mode=S_IFDIR|S_ISGID|0570, st_size=4096, ...}) = 0
lstat64("/www/htdocs/transfer/levelA/levelB/user1234/..........", 0xbfb2943c) = -1 ENOENT (No such file or directory)
stat64("/www/auth/userbase_dbm", {st_mode=S_IFREG|0640, st_size=49152, ...}) = 0
open("/www/auth/userbase_dbm", O_RDONLY|O_LARGEFILE) = 19
fcntl64(19, F_SETFD, FD_CLOEXEC)        = 0
read(19, "\0\0\0\0\1\0\0\0\0\0\0\0a\25\6\0\10\0\0\0\0\20\0\0\0\10\0\0\0\0\0\0"..., 512) = 512
close(19)                               = 0
open("DB_CONFIG", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
stat64("/var/tmp", 0xbfb28a1c)          = -1 ENOENT (No such file or directory)
stat64("/usr/tmp", 0xbfb28a1c)          = -1 ENOENT (No such file or directory)
stat64("/temp", 0xbfb28a1c)             = -1 ENOENT (No such file or directory)
stat64("/tmp", {st_mode=S_IFDIR|S_ISVTX|0777, st_size=4096, ...}) = 0
time(NULL)                              = 1268410964
gettimeofday({1268410964, 282964}, NULL) = 0
open("/proc/stat", O_RDONLY)            = 19
fstat64(19, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7011000
read(19, "cpu  169956 4550 15441 34352384 "..., 1024) = 967
read(19, "", 1024)                      = 0
close(19)                               = 0
munmap(0xb7011000, 4096)                = 0
open("/www/auth/userbase_dbm", O_RDONLY|O_LARGEFILE) = 19
fcntl64(19, F_SETFD, FD_CLOEXEC)        = 0
fstat64(19, {st_mode=S_IFREG|0640, st_size=49152, ...}) = 0
pread64(19, "\0\0\0\0\1\0\0\0\0\0\0\0a\25\6\0\10\0\0\0\0\20\0\0\0\10\0\0\0\0\0\0"..., 4096, 0) = 4096
pread64(19, "\0\0\0\0\1\0\0\0\2\0\0\0\0\0\0\0\7\0\0\0^\0\350\0\0\2\367\17\354\17\343\17"..., 4096, 8192) = 4096
close(19)                               = 0
stat64("/www/auth/userbase_dbm", {st_mode=S_IFREG|0640, st_size=49152, ...}) = 0
open("/www/auth/userbase_dbm", O_RDONLY|O_LARGEFILE) = 19
fcntl64(19, F_SETFD, FD_CLOEXEC)        = 0
read(19, "\0\0\0\0\1\0\0\0\0\0\0\0a\25\6\0\10\0\0\0\0\20\0\0\0\10\0\0\0\0\0\0"..., 512) = 512
close(19)                               = 0
open("DB_CONFIG", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
stat64("/var/tmp", 0xbfb28a6c)          = -1 ENOENT (No such file or directory)
stat64("/usr/tmp", 0xbfb28a6c)          = -1 ENOENT (No such file or directory)
stat64("/temp", 0xbfb28a6c)             = -1 ENOENT (No such file or directory)
stat64("/tmp", {st_mode=S_IFDIR|S_ISVTX|0777, st_size=4096, ...}) = 0
time(NULL)                              = 1268410964
gettimeofday({1268410964, 355124}, NULL) = 0
open("/proc/stat", O_RDONLY)            = 19
fstat64(19, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7011000
read(19, "cpu  169963 4550 15441 34352390 "..., 1024) = 967
read(19, "", 1024)                      = 0
close(19)                               = 0
munmap(0xb7011000, 4096)                = 0
open("/www/auth/userbase_dbm", O_RDONLY|O_LARGEFILE) = 19
fcntl64(19, F_SETFD, FD_CLOEXEC)        = 0
fstat64(19, {st_mode=S_IFREG|0640, st_size=49152, ...}) = 0
pread64(19, "\0\0\0\0\1\0\0\0\0\0\0\0a\25\6\0\10\0\0\0\0\20\0\0\0\10\0\0\0\0\0\0"..., 4096, 0) = 4096
pread64(19, "\0\0\0\0\1\0\0\0\2\0\0\0\0\0\0\0\7\0\0\0^\0\350\0\0\2\367\17\354\17\343\17"..., 4096, 8192) = 4096
pread64(19, "\0\0\0\0\1\0\0\0\7\0\0\0\2\0\0\0\0\0\0\0N\0\"\3\0\2\367\17\252\17\241\17"..., 4096, 28672) = 4096
close(19)                               = 0
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx

[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux