views:

145

answers:

3

What's quicker: serving a static HTML file from the filesystem or from MemCache?

Also, is there scaling and/or other concerns I should be aware of?

+1  A: 

It depends on the site. I'm sure if you benchmarked a simple small static web page that's not dynamic versus a database powered memcached site the former would be "quicker", but this can totally differ depending on the variables at hand, there are just too many factors to take into account to give you a simple yes or no answer.

meder
A: 

Like any performance-related issue: benchmark. It's highly dependent on architecture, server setup, network, disk, etc. This question sounds simple enough to benchmark in a few mins with a load testing tool.

Ryan Doherty
A: 

It depends on whether the filesystem is local or over the network. It also depends on what your network connection speeds are.

Data will change based on how the file is used and whether or not the web servers are in a cluster (and if the individual web servers need to generate the file once and then cache it).

I'd be willing to bet that serving a local file from the filesystem is going to be faster than using Memcache to serve the file (especially if it's a fast SATA drive) -- simply because you're cutting out the network layer of the equation.

Even when installed locally, your app would need to use the network stack to access Memcache, and that's going to involve some overhead.

Dan Esparza