srcache + mogilefs module

agentzh agentzh at
Sat Apr 21 04:45:17 UTC 2012

On Sat, Apr 21, 2012 at 4:16 AM, haad <nginx-forum at> wrote:
> My problem is that it seems that even if I put files to memcache
> manually and it srcache will find it (see log below), my file is still
> served from mogilefs and not from memcached.

What does the data you put into memcached look like? The ngx_srcache
module requires the value to be the *whole* response, that is,
including the status line and all those response headers.

Basically, you should rely on ngx_srcache's srcache_store to store the
responses automatically for you, rather than inserting values into
memcached yourself.

> 2012/04/20 21:28:21 [debug] 7385#0: *501 memcached: "VALUE
> /share/file.html 0 10" <---- WE got it

Yes, ngx_srcache got the value from memcached here.

> 2012/04/20 21:28:21 [error] 7385#0: *501 srcache_fetch: cache sent
> invalid status line while sending to client, client:,
> server:, request: "GET /share/file.html HTTP/1.0",
> subrequest: "/memc", upstream: "memcached://", host:
> ""

But here, ngx_srcache then found the value is invalid in that it does
not have a valid HTTP status line at the beginning, so it immediately
abandoned the cached value, and treated it as a cache miss.

> From this log I can see why is file can't serverd from memcached, server
> status 200.

Maybe I should make the debug log more verbose a bit here ;)

> Are srcache and mogilefs module somehow incompatible ?

ngx_srcache is designed to be backend independent ;) If it's not, then
there must be a bug somewhere ;)

In your case here, it seems to be the bad format of the data that you
manually inserted into memcached.

Best regards,

More information about the nginx mailing list