[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Why does SVN + apache try to close non existing file descriptors?

From: Jon Bendtsen <jbendtsen_at_laerdal.dk>
Date: Wed, 12 Mar 2008 14:45:32 +0100

Hi

I have a problem with SVN and/or apache which does not apply to
svnserve.
I use svn log to test this, but my users complain that any SVN command
is slow.

Using svnserve directly it takes less than a second to get an output
of svn log.
Using SVN through apache it takes about 28 minutes to get a log.

So i used strace on apache and it turns out it tries to close
1024*1024 file descriptors
more than once. Every time takes almost a minute. It starts 41 times,
but for some reason
it does not count to 1024*1024 every time. But it does count to
1024*1024 22 times,
and some times only to some hundred thousand times. The error message
is like this
        13:47:17 close(227260) = -1 EBADF (Bad file descriptor)
Most of the times the processes only have a few files open, so
anything after 2 or 3
gets an error message. This means i get a strace file with 1024 * 1024
error lines.

Q) why brute force close all files?
        a) ask the kernel to close all my open files
        b) ask the kernel which files do I have open and then close only those
        c) remember what files i have open and then close only those

I "solved" the slowness problem by setting the hardlimit to 1024 pr.
apache
process, but using svn+apache is still slower than svnserve, and svn
+apache
still tries to close about 1020 non existing files, which i find is a
waste of resources.

This is ls of all strace files from this command:
        for pid in $(ps aux | grep apache | cut -b 10-15); do strace -t -p
$pid -o slow.$pid -ff & done
As you can see, some files get pretty big, so svn+apache must waste
alot of resources trying
to close 1024*1024 nonexisting files.

-rw-r--r-- 1 root root 0 Mar 12 13:21 slow.5928
-rw-r--r-- 1 root root 76556314 Mar 12 13:22 slow.5318.6075
-rw-r--r-- 1 root root 76556314 Mar 12 13:23 slow.5318.6337
-rw-r--r-- 1 root root 76556314 Mar 12 13:24 slow.5318.6394
-rw-r--r-- 1 root root 71695658 Mar 12 13:25 slow.5307.6371
-rw-r--r-- 1 root root 76556379 Mar 12 13:26 slow.5321.6765
-rw-r--r-- 1 root root 76556314 Mar 12 13:26 slow.5318.7157
-rw-r--r-- 1 root root 72944829 Mar 12 13:26 slow.5307.6450
-rw-r--r-- 1 root root 76556314 Mar 12 13:28 slow.5321.7903
-rw-r--r-- 1 root root 76556314 Mar 12 13:29 slow.5318.8002
-rw-r--r-- 1 root root 76556379 Mar 12 13:30 slow.5320.8124
-rw-r--r-- 1 root root 138916 Mar 12 13:31 slow.5307.9705
-rw-r--r-- 1 root root 136108 Mar 12 13:31 slow.5307.9704
-rw-r--r-- 1 root root 137098 Mar 12 13:31 slow.5307.9733
-rw-r--r-- 1 root root 76556379 Mar 12 13:32 slow.5322.8779
-rw-r--r-- 1 root root 76556314 Mar 12 13:32 slow.5321.8815
-rw-r--r-- 1 root root 76556379 Mar 12 13:32 slow.5319.8855
-rw-r--r-- 1 root root 638243 Mar 12 13:32 slow.5307.9707
-rw-r--r-- 1 root root 1206081 Mar 12 13:33 slow.5307.9708
-rw-r--r-- 1 root root 76556314 Mar 12 13:33 slow.5318.9306
-rw-r--r-- 1 root root 126265 Mar 12 13:33 slow.5307.9048
-rw-r--r-- 1 root root 76556314 Mar 12 13:35 slow.5319.10001
-rw-r--r-- 1 root root 76556314 Mar 12 13:35 slow.5322.9850
-rw-r--r-- 1 root root 474476 Mar 12 13:35 slow.5307.6778
-rw-r--r-- 1 root root 76556314 Mar 12 13:35 slow.5318.10705
-rw-r--r-- 1 root root 76556314 Mar 12 13:37 slow.5319.11034
-rw-r--r-- 1 root root 76556314 Mar 12 13:37 slow.5318.11059
-rw-r--r-- 1 root root 67824798 Mar 12 13:38 slow.5307.7655
-rw-r--r-- 1 root root 76556314 Mar 12 13:39 slow.5319.12559
-rw-r--r-- 1 root root 76556314 Mar 12 13:39 slow.5318.12629
-rw-r--r-- 1 root root 65815368 Mar 12 13:41 slow.5307.8012
-rw-r--r-- 1 root root 76556314 Mar 12 13:42 slow.5319.12825
-rw-r--r-- 1 root root 76556314 Mar 12 13:43 slow.5318.12836
-rw-r--r-- 1 root root 76556379 Mar 12 13:43 slow.5322.13169
-rw-r--r-- 1 root root 66366551 Mar 12 13:44 slow.5307.8129
-rw-r--r-- 1 root root 76556314 Mar 12 13:45 slow.5319.14382
-rw-r--r-- 1 root root 76556314 Mar 12 13:46 slow.5318.14452
-rw-r--r-- 1 root root 76556314 Mar 12 13:46 slow.5322.14461
-rw-r--r-- 1 root root 48226304 Mar 12 13:47 slow.5319.15656
-rw-r--r-- 1 root root 35885056 Mar 12 13:47 slow.5318.15907
-rw-r--r-- 1 root root 61104128 Mar 12 13:47 slow.5307.9356
-rw-r--r-- 1 root root 63528960 Mar 12 13:47 slow.5307.9044
-rw-r--r-- 1 root root 28590080 Mar 12 13:47 slow.5307.12631
-rw-r--r-- 1 root root 30232576 Mar 12 13:47 slow.5307.12623
-rw-r--r-- 1 root root 831488 Mar 12 13:47 slow.5307.7902
-rw-r--r-- 1 root root 13615104 Mar 12 13:47 slow.5307.14380
-rw-r--r-- 1 root root 2695168 Mar 12 13:47 slow.5318.16154
-rw-r--r-- 1 root root 225280 Mar 12 13:47 slow.5318
-rw-r--r-- 1 root root 49152 Mar 12 13:47 slow.5307.9722
-rw-r--r-- 1 root root 1417216 Mar 12 13:47 slow.5307.16148
-rw-r--r-- 1 root root 0 Mar 12 13:47 slow.5307.16163
-rw-r--r-- 1 root root 64528384 Mar 12 13:47 slow.5307.9215
-rw-r--r-- 1 root root 20271104 Mar 12 13:47 slow.5307.13209
-rw-r--r-- 1 root root 389120 Mar 12 13:47 slow.5307.9358
-rw-r--r-- 1 root root 503808 Mar 12 13:47 slow.5307.8866
-rw-r--r-- 1 root root 270336 Mar 12 13:47 slow.5307.8164
-rw-r--r-- 1 root root 716800 Mar 12 13:47 slow.5307.8163
-rw-r--r-- 1 root root 1011712 Mar 12 13:47 slow.5307.8162
-rw-r--r-- 1 root root 501678 Mar 12 13:47 slow.5307.6376
-rw-r--r-- 1 root root 666947 Mar 12 13:47 slow.5321
-rw-r--r-- 1 root root 438096 Mar 12 13:47 slow.5320
-rw-r--r-- 1 root root 536576 Mar 12 13:47 slow.5322
-rw-r--r-- 1 root root 188416 Mar 12 13:47 slow.5307
-rw-r--r-- 1 root root 69632 Mar 12 13:47 slow.5307.6369
-rw-r--r-- 1 root root 536576 Mar 12 13:47 slow.5319
-rw-r--r-- 1 root root 786432 Mar 12 13:47 slow.5307.8132
-rw-r--r-- 1 root root 159744 Mar 12 13:47 slow.5307.8130
-rw-r--r-- 1 root root 27796 Mar 12 13:47 slow.5307.8884
-rw-r--r-- 1 root root 60106 Mar 12 13:51 slow.5307.6076

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-03-12 14:45:58 CET

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.