# Memcached vs. static pages

**URL:** <https://www.ruby-forum.com/t/memcached-vs-static-pages/161946>\
**Category:** NGINX\
**Created:** [March 4, 2009, 5:00am UTC](https://www.ruby-forum.com/t/memcached-vs-static-pages/161946 "2009-03-04T05:00:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_Rhoden](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/e19adc/32.png) [@Daniel\_Rhoden](https://www.ruby-forum.com/u/Daniel_Rhoden)\
**Post date:** [March 4, 2009, 5:00am UTC](https://www.ruby-forum.com/t/memcached-vs-static-pages/161946/1 "2009-03-04T05:00:50Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Daniel\_Rhoden](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/e19adc/32.png) [@Daniel\_Rhoden](https://www.ruby-forum.com/u/Daniel_Rhoden)\
**Post date:** [March 4, 2009, 6:19am UTC](https://www.ruby-forum.com/t/memcached-vs-static-pages/161946/2 "2009-03-04T06:19:46Z")

</div>

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

Note that sendfile won’t help if utilizing HTTPS.

---

<div class="post-metadata">

**Author:** ![Daniel\_Rhoden](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/e19adc/32.png) [@Daniel\_Rhoden](https://www.ruby-forum.com/u/Daniel_Rhoden)\
**Post date:** [March 4, 2009, 6:02am UTC](https://www.ruby-forum.com/t/memcached-vs-static-pages/161946/3 "2009-03-04T06:02:49Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Daniel\_Rhoden](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/e19adc/32.png) [@Daniel\_Rhoden](https://www.ruby-forum.com/u/Daniel_Rhoden)\
**Post date:** [March 4, 2009, 8:03am UTC](https://www.ruby-forum.com/t/memcached-vs-static-pages/161946/4 "2009-03-04T08:03:51Z")

</div>

hi, maybe this can help you [www.ncache.org](http://www.ncache.org)
