2

Been dealing with growing demands for system resources on a website, and got me thinking:

What's the fastest way to server a single static webpage from a single server in memory?

Feel free to ask for clarifications, basically trying to reduce the application stack as much as possible, use as little memory as possible, but keep the system in memory as much as possible. Guessing the static webpage would not over https and would be 20k, no images, and inline CSS/JS; meaning it's one file. More points for lower cost/resource systems.

4 Answers 4

4

Feel like running linux 2.4 with a memory filesystem and Tux? That still ranks among the fastest I've run. Highest clock speed CPU you can find and you're set.

Varnish would be #2. We've thrown six machines at it generating requests, filled a 10GB pipe, and it just keeps serving without a hint that the source machine is having any problems.

Nginx can serve content from memcached, and can cache that internally.

3
  • @karmawhore - All sound like good answers, what would you say is the bottleneck I'd hit first as a result of hardware serving a single 20k file over HTTP on with as many one-time connections as possible?
    – blunders
    Oct 11, 2010 at 17:58
  • 1
    TCP tuning is usually where you run into issues. A static file is usually buffered by the OS if it is hot, so, many solutions are serving from ram anyhow. Urban Airship has documented the c500k issue (the evolution of Dan Kegel's c10k document)
    – karmawhore
    Oct 11, 2010 at 18:05
  • @karmawhore - Thanks, good info! blog.urbanairship.com/blog/2010/09/29/…
    – blunders
    Oct 11, 2010 at 19:26
2

A custom C app that implements a minimal subset of HTTP and outputs the page previously stored in a variable.

3
  • @Ignacio_Vazquez-Abrams: Basically sounds like the right answer, except the "best" answer would not have "custom" in it. Still, nice answer.
    – blunders
    Oct 11, 2010 at 17:39
  • 1
    Personally I'd use CherryPy or Twisted Web, but the question did mention 1) fastest, and 2) reduced footprint. Oct 11, 2010 at 17:42
  • Interesting -- appears cherrypy.org servers apps in their own multi-threaded web server. Nice... :-)
    – blunders
    Oct 11, 2010 at 17:48
1

tHTTPd is the lightest HTTPd I know of, and it still supports quite a few basic functions. It's open source, an order of magnitude faster than Apache, and 50k compiled. In small page requests, Zeus beats it, but doesn't have the features and isn't free/oss (you do get support however).

2
  • @Chris_S: Even if it turns out to not be a good fit for my needs... Really like the Web Server Comparisons benchmarks given by them, thanks!! -- acme.com/software/thttpd/benchmarks.html
    – blunders
    Oct 11, 2010 at 19:23
  • EDIT: Strike that, the benchmarks are from 1998... wow!
    – blunders
    Oct 11, 2010 at 19:55
0

Easily the fastest thing I've seen in this area is the use of one or more Zeus ZXTM appliances as a cache in front of a 'proper' web server.

The whole of the BBC serves its static content from 4 of these things - they're 64-bit so can cache huge amounts and can saturate multiple 10Gbps NICs - I've certainly never seen anything do just that, not even Cisco's CDN boxes. That said they're REALLY expensive but we use them and they just blew me away.

I'm sure there's a free equivalent that I'm not aware of however.

3
  • Zeus ZXTM sound pretty cool, way out of the realm I'm in though... :-)
    – blunders
    Oct 11, 2010 at 17:51
  • 1
    fair enough - this is the problem with questions (not just yours) asking for 'fastest'/'best' etc. Often the fastest and best cost, perhaps consider including a direction towards budget in future questions?
    – Chopper3
    Oct 11, 2010 at 18:00
  • 1
    Yes, I knew that was an issue, still don't even completely understand the question itself, but figured I'd learn something. And I agree about budget, tried to cover that with "More points for lower cost/resource systems."
    – blunders
    Oct 11, 2010 at 18:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .