Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to find the most optimal machine configuration for a web cache that will serve HTTP-segmented video to a few thousand concurrent viewers.

The content is composed of periodically updating text files (called manifests) which are a few bytes in size (100 - 500 bytes) and a set of video segment files which are thousands of bytes in size (52,000 - 250,000 bytes).

My setup has a live video origin server that puts these files onto a WebDAV-enabled server (which will be an appropriately configured Apache or Nginx). I would like to front this this "origin" setup at multiple locations using standard hardware and open-source software for serving the user population.

My questions are:

  • I am considering a combination of Nginx + Varnish on my edge caches. Does that sound reasonble?
  • What would be a good machine config? I am considering 3X2TB 7200RPM HDD in RAID5 and 24GRAM, 1 quad code CPU. Is that good for Varnish? Is there a particular parameter I need to optimize to get the best out of Varnish?
  • Does it make sense to setup Varnish in HA pairs or are they usually setup standalone?
share|improve this question
up vote 0 down vote accepted

Nginx can do the caching on its own with the proxy_cache module, although Varnish has more features (which you may not need). You will likely be IO bound with this task, not CPU bound. So I would really look at lots of RAM for caching, or SSDs. RAID5 is a terrible idea (small random writes are very slow with RAID5), as are SATA drives for an high IO task (they can only do about 70 IOPS per disk, divided by a factor of 4 for RAID5 writes).

Still even with 10000 concurrent streams and 5 second video segments, you're talking only about 2000 random IOPs worst-case. Any SSD can handle this assuming it is big enough, and if the data set is small enough, file-system cache will get you there.

share|improve this answer
Hi rmalayter, Thanks for the insightful response. I want some degree of peace of mind in knowing that a disk failure will not bring down an edge cache. Is RAID5 slow for read as well as write? Is there another way to make my storage more robust? Also I heard Varnish uses multiple thread. More cores == more threads. Does that logic work? – Raj Jun 16 '11 at 5:44
I would suggest RAID-1 or RAID-10 to avoid a random write pentalty. Caches do a LOT of random writes for updates (and random reads too, assuming the dataset doesn't fit in RAM). You haven't mentioned what the total size and popularity distribution of the video library is. This makes a big difference in sizing a cache. As for the CPUs, nginx can run multiple workers (each small and capable of 10000+ concurrent connections). So both nginx and Varnish can use many CPU threads, although nginx will use far less CPU for the same workload. You should consider using a CDN for this task though. – rmalayter Jun 16 '11 at 12:51
Hi Malaytar, Thanks again. I am building sort of a local CDN for controlled OTT delivery. – Raj Jun 16 '11 at 23:30

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.