Re: Apache Startup Time

Binesh Bannerjee <[email protected]> Wed, 4 Sep 2002 12:25:15 -0400 (EDT)
Newsgroups gmane.comp.apache.mod-mp3
Message-ID <Pine.LNX.4.44.0209041207541.3751-100000@client.cablemodem.hex21.com>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wed, 4 Sep 2002, Torben Janssen wrote:

> Hi,
>
> i'm using mod_mp3 with ampache and like it very much.
> I have a loooong Apache Startuptime since I use mod_mp3. I searched a bit
> an found out that ampache read recursively though my mp3-collection at
> every startup, right?
>
> Is there any possibilty to accelerate the startup-process?

I'm writing a patch to do this. I have about 17000 mp3s, and it takes
about 5 minutes to start up as well. In reality the time is mostly spent
ripping out ID3 info and md5 summing the title. So, my patch caches that
info into a file, and simply verifies on startup that the file _size_ and
_mtime_ have not changed. If either has, it reads info for _that_ file
only again. I've reduced the startup time from 5 minutes to 3 seconds
with this patch. (And I've added mp3's to my collection since, and
stopped and restarted the web server.)

You can use the patch, but usual caveats apply, I only wrote it very
recently, and it uses malloc/free instead of the whole apache pool
structure. I'm in the midst of reengineering it to use an apache
subpool. I'll post that here, when I'm done with that.

It works fine for me tho. I'd appreciate another pair of eyes looking
over the memory stuff tho. I've written NSAPI's before, and I
know how easy it is to miss something. If I could change the call to
function: mp3_create_content to take an additional parameter
I'd be able to write it so that the entire cache was built and
destroyed in load_directory or load_playlist (in an apache subpool).

(Brian, would that be acceptable? To change the call to mp3_create_content?
I see it being used in mod_mp3.c and playlist_dispatch.c, I'd simply add
NULL values for the cache entry there.)

I just didn't want to change function signatures (just to be polite to other
patch writers.)

ANYWAY, The patch is in the archives, here's a link to it:
	http://lists.tangent.org/pipermail/mod_mp3/2002-September/000640.html

If you can't rip it out of there from it's htmlized format, email me, and
I'll send you the patch directly, if you want it.

Binesh Bannerjee

>
> thanks in advance
>     Torben Janssen
>
> _______________________________________________
> Mod_mp3 mailing list
> [email protected]
> http://lists.tangent.org/mailman/listinfo/mod_mp3
>

- --
"Damn the torpedoes, full speed ahead!" -- Admiral David Farragut

    PGP  Key: http://www.hex21.com/~binesh/binesh-public.asc
    	Key fingerprint = 421D B4C2 2E96 B8EE 7190  A0CF B42F E71C 7FC3 AD96
    SSH2 Key: http://www.hex21.com/~binesh/binesh-ssh2.pub
    SSH1 Key: http://www.hex21.com/~binesh/binesh-ssh1.pub
OpenSSH  Key: http://www.hex21.com/~binesh/binesh-openssh.pub
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)
Comment: pgpenvelope 2.10.2 - http://pgpenvelope.sourceforge.net/

iD8DBQE9djP4tC/nHH/DrZYRAlzmAJ4iwuRBo/MFpNYdk0eVs54WW95fBwCbBjqr
bklK2gjL20ryVL3YFoPo7ao=
=YHuc
-----END PGP SIGNATURE-----