memcached problems...

JG nginx-forum at
Tue Sep 1 01:34:07 MSD 2009

normally, i whould agree. but in this special case the system has trouble to handle the high io load due to really lots of files (about 8 million.... i know... crazy, not my content).

to get a workaround for the hd io load, i just wanted to get nginx to load the swf and flv files into memcached which should be possible for my understanding. 

i think i found one of my problems, the missing fallback server if the content isnt already in memcached. 

but now i get 502 bad gateway error messages, and such strange error log entries

2009/08/31 23:21:17  30612#0: 8192 worker_connections is not enough while accepting new connection on

? no connections yet ... no production

but anyway, i trimmed down my config to a minimum for testing

    server {
        listen       81;
        server_name  _;

        #access_log  logs/host.access.log  main;

        location / {
            set $memcached_key  $uri;
            error_page 404 502  = /fallback;
#           default_type        text/html;

            root   /usr/share/nginx/html;
            index  index.html index.htm;

        location /fallback {

        location ~ \.php$ {
            set $memcached_key  $uri;

            root           /home/www/htdocs;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  /home/www/htdocs$fastcgi_script_name;
            include        fastcgi_params;

PHP works well, but it doesnt seem to get stored in memcached, why? and, for example if i try to download a zip file i get this in the error log

2009/08/31 23:30:16  30815#0: *12285 recv() failed (104: Connection reset by peer) while reading response header from upstream, client:, server: _, request: "GET /koch/_banner/paldauer/ HTTP/1.0", upstream: "", host: "", referrer: ""

please igor, anyhow if you got an idea how i can get nginx to use memcached to store content... 

greetings & thanks


Posted at Nginx Forum:,5434,5452#msg-5452

More information about the nginx mailing list