Mail Index

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

Re: [ApacheGallery] directory generating slowness

Michael Legart <[email protected]> writes:

> On Thu, Dec 09, 2004 at 12:05:39PM -0500, Doug Alcorn wrote:
>> The actual page generation code is unchanged except that
>> generate_directory dumps it's output to cache_dir($r, 0) .
>> "/index.html".  The the handler sub checks the timestamp on the
>> .cache/index.html versus the timestamp of the image directory and
>> either serves up the cached index or generates a new one.
> Have you done some performance testing on this? I will look at the patch
> later tonight.

Just a cursory one.  Again, running on my localhost Apple Powerbook
1.33Ghz G4 w/1.25GB RAM:

$ ls -l /Users/dalcorn/Pictures/2004/11-November/Princess\ Party/ | wc
     189    1694   13480
$ time wget --quiet http://gallery.localhost/2004/11-November/Princess%20Party/
real    0m23.170s
user    0m0.010s
sys     0m0.030s
$ ls -l /Users/dalcorn/Sites/gallery/cache/2004/11-November/Princess\ Party/  
total 72
-rw-r--r--  1 nobody  dalcorn  35979  9 Dec 13:47 index.html
$ sudo rm /Users/dalcorn/Sites/gallery/cache/2004/11-November/Princess\ Party/index.html
$ time wget --quiet  http://gallery.localhost/2004/11-November/Princess%20Party/

real    0m10.573s
user    0m0.010s
sys     0m0.000s
$ time wget --quiet  http://gallery.localhost/2004/11-November/Princess%20Party/

real    0m0.072s
user    0m0.000s
sys     0m0.010s

I think the first big drop in time is because the OS had all the file
stat in cache.  So, I think I can assuming the old directory
generation time is about 10 seconds.  Then notice that the subsequent
loads are very fast.

Another thing I did was add a $r->warn call to the beginning and end
of generate_directory so I could get timestamps of processing in

[Thu Dec  9 13:50:51 2004] [warn] starting to generate_directory /Users/dalcorn/Pictures/2004/11-November/Princess Party
[Thu Dec  9 13:51:02 2004] [warn] finished generating_directory /Users/dalcorn/Pictures/2004/11-November/Princess Party

Since generate_directory isn't called when the cache/index.html is
used there's nothing to compare to.  However, it doesn't seem like
generate_directory is consuming much time.  Certainly not 10 seconds.
So, maybe this is good maybe it's not.

[email protected]
users mailing list
[email protected]