[vox-tech] Performance tuning for http file serving

Brian Lavender brian at brie.com
Wed Apr 14 23:23:43 PDT 2010


On Tue, Apr 13, 2010 at 12:23:23AM -0700, Bill Broadley wrote:
> On 03/31/2010 05:12 PM, Alex Mandel wrote:
> > I'm looking for some references and tips on how to tune a server
> > specifically for serving large files over the internet. ie 4 GB iso
> > files. I'm talking software config tweaks here.
> 
> How many 4GB ISO files are there?  How many simultaneous files? 
> Clients?  How fast is the uplink to er, umm, wherever the clients are 
> (on the internet)?
> 
> > The system is using a RAID with striping, the filesystem is XFS (some
> > tuning there maybe?)
> 
> Your enemy is random access, I wouldn't expect XFS, ext2/3/4, jfs, or 
> any of the many other alternatives to make much difference.
> 
> > and will be running Apache2.2 all on a Debian
> > Stable install if that helps. It's got 2 2.5ghz cores and 8GB of ram
> > (those can be adjusted since it's actually a kvm virtual machine).
> 
> Well your enemy is random access.  To keep things simple lets just 
> assume a single disk.  If you have one download and relatively current 
> hardware you should be able to manage around 80-90MB/sec (assuming your 
> network can keep up).
> 
> What gets ugly is if you have 2 or more clients accessing 2 or more 
> files.  Suddenly it becomes very very important to intelligently handle 
> your I/O.  Say you have 4 clients, reading 4 ISO files, and a relatively 
> stupid/straight forward I/O system.  Say you read 4KB from each file (in 
> user space), then do a send.

That's like operating a disk in PIO mode. I would think something that
can leverage the DMA controller better would avoid thrashing. Perhaps
there is a way to tell apache to use memory cache and dump readaheads
into memory. Linux should be able to handle this fine. 

I was looking to see if there is a config on this, but I can't find one
at the moment. I was looking at this cache page.

http://httpd.apache.org/docs/2.2/mod/mod_mem_cache.html

I imagine someone else has encountered this problem before.

brian
-- 
Brian Lavender
http://www.brie.com/brian/

"Those that fail to learn from history, are doomed to repeat it." 
- Winston Churchill


More information about the vox-tech mailing list