Question about memcache

Hello,
I am trying to add memcache module in Nginx.

Following
http://wiki.nginx.org/NginxHttpMemcachedModule

In Levent’s blog, in the end, he mentioned

"Nginx’s memcache module never put anything automatically in memcached.
You have to store your information in it manually by using something
like a script. Considering our example, if we forget to store
information about a file in memcached, it will be always served by
back-end Apache servers. Here is a simple php script, which finds given
image types and deploy it into memcached for Nginx. "

I want to know whether it is still valid? Since the blog is one year
ago. Maybe Nginx improve memcache module in the middle.

For dynamically generate webpage on the backend server (query mysql
database), I do not have static files. So how can I use memcache to
record dynamically created webpage in front server? (Nginx frontend
server is running in 192.168.2.1, and backend server running in
192.168.2.2)

Thanks,
Yanxin

On 21 Abr 2011 19h32 WEST, [email protected] wrote:

using something like a script. Considering our example, if we forget
to store information about a file in memcached, it will be always
served by back-end Apache servers. Here is a simple php script,
which finds given image types and deploy it into memcached for
Nginx. "

I want to know whether it is still valid? Since the blog is one year
ago. Maybe Nginx improve memcache module in the middle.

AFAIK it’ still the case: the nginx memcache official module is a
write only thing. you can however use agentzh’s memc module that
supports also writing and more:

https://github.com/agentzh/memc-nginx-module

http://wiki.nginx.org/HttpMemcModule

For dynamically generate webpage on the backend server (query mysql
database), I do not have static files. So how can I use memcache to
record dynamically created webpage in front server? (Nginx frontend
server is running in 192.168.2.1, and backend server running in
192.168.2.2)

See above.

— appa

Thank you for your help, António.

I have a question here, instead of memcache module, can I use other
moudule, like proxy_cache, fastcgi_cache?

What is the advantage and disadvantage of using memcache?

Yanxin

On Fri, Apr 22, 2011 at 6:20 AM, Yanxin Z. [email protected] wrote:

Thank you for your help, Antnio.

I have a question here, instead of memcache module, can I use other
moudule, like proxy_cache, fastcgi_cache?

What is the advantage and disadvantage of using memcache?

The main advantage of using memcached is that you can have a
distributed cache layer in a cluster setting by means of client-side
key hashing. When you do have a lot of stuffs to cache or your disk is
slow, it’ll be a big win. You may want to combine it with the
ngx_srcache module:

http://github.com/agentzh/srcache-nginx-module

The main disadvantage atm is that ngx_srcache is rather weak in terms
of functionality as compared to proxy_cache and fastcgi_cache. Also,
memcached has a limit on item size (1MB), though most of the time,
your pages are smaller than 1MB.

Cheers,
-agentzh

Thank you so much, Yichun.
I am going to use proxy_cache for my application then.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs