April 21, 2012 05:49PM
agentzh Wrote:
-------------------------------------------------------
> On Sat, Apr 21, 2012 at 4:16 AM, haad
> <nginx-forum@nginx.us> 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.

It was simple string, so yes this was the problem.

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

But from attached log or this new [1] dump it seems tat srcache_store is never called.
I was not aware of this, it should be added to documentation :).

[1] https://gist.github.com/2439805


>
> > 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: 192.168.200.64,
> > server: ws01x.test.reality.sk, request: "GET
> /share/file.html HTTP/1.0",
> > subrequest: "/memc", upstream:
> "memcached://192.168.206.3:11211", host:
> > "192.168.200.64"
>
> 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.

I will try to add proper entry and try again, right now I would like to know why
srcache_store do not work as expected. Here is config

location = /memc {
internal;
memc_connect_timeout 100ms;
memc_send_timeout 100ms;
memc_read_timeout 100ms;

set $memc_key $query_string;
set $memc_exptime 300;

memc_pass memcached_servers;
}

location /share/ {
set $key $uri;

srcache_fetch GET /memc $key;
srcache_store PUT /memc $key;
srcache_store_statuses 200 301 302;
srcache_response_cache_control off;

[snip]
Subject Author Posted

srcache + mogilefs module

haad April 20, 2012 04:16PM

Re: srcache + mogilefs module

agentzh April 21, 2012 12:46AM

Re: srcache + mogilefs module

haad April 21, 2012 05:49PM

Re: srcache + mogilefs module

agentzh April 21, 2012 11:32PM

Re: srcache + mogilefs module

haad April 22, 2012 02:14AM

Re: srcache + mogilefs module

agentzh April 22, 2012 11:42PM

Re: srcache + mogilefs module

haad April 23, 2012 06:58AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 231
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready