NginxHttpMemcModule vie NginxHttpMemcachedModule

Hello group,
I saw there are 2 modules for using with memcached. I wonder that can I
recompile nginx with both of them?

Can you share simple nginx.conf but complete that works with either
module, please?

Thanks,

Danny Trinh
Linux Admin

On Tue, Dec 29, 2009 at 6:51 AM, Danny Trinh
[email protected] wrote:

Hello group,
I saw there are 2 modules for using with memcached. I wonder that can I
recompile nginx with both of them?

Yes :slight_smile:

Can you share simple nginx.conf but complete that works with either
module, please?

There’s lots of sample configurations for ngx_memc on the wiki:

http://wiki.nginx.org/NginxHttpMemcModule

and some for ngx_memcached as well:

http://wiki.nginx.org/NginxHttpMemcachedModule

BTW, none of them can be serve as a transparent content cache out of
the box. I can think of a ngx_cache module just like Apache2’s
mod_cache (with various storage backends like mod_disk_cache,
mod_mem_cache, and mod_libmemcached_cache in that context). Is anyone
already working on that?

Cheers,
-agentzh

BTW, none of them can be serve as a transparent content cache out of
the box. I can think of a ngx_cache module just like Apache2’s
mod_cache (with various storage backends like mod_disk_cache,
mod_mem_cache, and mod_libmemcached_cache in that context). Is anyone
already working on that?

I’ve got mixed feelings about this.

Regarding memcached / other storage backends:
I would love to see memcached module which would be able to act as a
transparent cache for proxy/fastcgi/slowfs and save content to memcached
cluster(!), but the way I see it, it cannot be easily implemented as a
module. In my opinion change of storage backends should be as
transparent as
possible, which means that this should be implemented as modification of
existing {proxy,fastcgi,slowfs}_cache_path or addition of similar
{proxy,fastcgi,slowfs}_memcached_path and nothing more (from
configuration
point of view).

This should be fairly easy to implement as a patch. Calling
memcached_set
function instead of ngx_ext_rename_file() in
ngx_http_file_cache_update()
should do the trick for writing and calling memcached_get function
instead
of ngx_http_file_cache_read() in ngx_http_file_cache_open() should do
the
trick for reading :wink:

(Yes, I already did the hard part :P)

Implementing this as a module probably wouldn’t be as easy and as clean
(configuration-wise).

But does anyone actually need such feature?

Regarding ngx_cache module:
I believe it is NOT needed. It would be a lot(!) of code replicated from
nginx base, which would be a nightmare to maintain and keep compatible
with
all existing nginx versions. Also, it wouldn’t add any real benefits
over
existing {proxy,fastcgi,slowfs}_caches and memcached storage backend
described above.

But this is just my opinion :wink:

Best regards,
Piotr S. < [email protected] >

And that is the problem. We have many modules doing similar jobs, and
none of them is easy for users to get them work. I’m an admin, I can
feel how much frustrated it is. I think what the users want is the
module has easy way to setup and/or the clear sample/instruction that
they can go through. I’m not a developer, but I can help to test thing
out.
Thanks,

Danny Trinh
Linux Admin