Memcached vs. static pages


#1

Hopefully this is a simple question to answer. Is there any
performance benefit of going to the trouble of setting up memcached
for static pages? I guess the question is, does nginx have its own
form of storing frequently requested static resources, or does it read
from the hard drive each time is serves those requests?

My gut tells me nginx has something already built in to optimize
requests for static pages without the complexity of memcached.

Thanks community!

–Daniel Rhoden


#2

For zero-copy I/O:
http://wiki.codemongers.com/NginxHttpCoreModule#sendfile
For serving static content:
http://wiki.codemongers.com/NginxHttpGzipStaticModule

Note that sendfile won’t help if utilizing HTTPS.


#3

On 4/03/2009, at 4:47 PM, Daniel Rhoden wrote:

Hopefully this is a simple question to answer. Is there any
performance benefit of going to the trouble of setting up memcached
for static pages? I guess the question is, does nginx have its own
form of storing frequently requested static resources, or does it
read from the hard drive each time is serves those requests?

My gut tells me nginx has something already built in to optimize
requests for static pages without the complexity of memcached.

Hi Daniel,

Nginx (to my knowledge) doesn’t have such a facility, nor does it need
one. The VM system of the operating system you’re using will cache oft
accessed data in memory, thus it won’t always be read from disk.

So you’re experiencing high disk IO with just static pages, the best
thing you can do in the short term is add more memory (which Memcache
would need otherwise anyway)

Cheers

Phil


#4

hi, maybe this can help you www.ncache.org