Welcome! Log In Create A New Profile

Advanced

nginx+memcached: file size limits or broken images

Posted by apaskal 
nginx+memcached: file size limits or broken images
May 12, 2010 03:06AM
Hi!
I configured memcached and it works well with small image files. For example 2796 bytes gif.
But when I requests 29514 bytes jpg image nginx returns broken image (11310 bytes).
When I requests 35746 bytes jpg nginx returns broken image (16635 bytes)

What should I see?
Thanks in advance.

My environment
nginx(0.8.36)+memcached (1.2.8) on CentOS release 5.4 (Final)


nginx config:
[code]
location ~ \.(gif|png|jpg)$ {
access_log off;
#expires max;
#add_header Last-Modified "Thu, 26 Mar 2000 17:35:45 GMT";
#set $memcached_buffer_size 102400;
#memcached_buffer_size 102400;
set $memcached_key $uri;
memcached_pass 127.0.0.1:11211;
error_page 404 = @fetch;
}

location @fetch {
#internal;
access_log off;
#expires max;
#add_header Last-Modified "Thu, 26 Mar 2000 17:35:45 GMT";

# virtual host of the same enginx instance
proxy_pass http://$NGINXVIRTUALHOST;
#break;
}
[/code]



Edited 1 time(s). Last edit at 05/12/2010 03:06AM by apaskal.
Re: nginx+memcached: file size limits or broken images
April 19, 2012 08:33AM
Hi apaskal,

Have you solved this problem?
Re: nginx+memcached: file size limits or broken images
April 25, 2012 06:56AM
You might want to try to play with:

large_client_header_buffers 4 16k;

And on the memcached side, (from the man page )
-I Override the size of each slab page in bytes. In mundane words, it adjusts the maximum item size that memcached will accept. You can use the suffixes K and M to specify the size as well, so use 2000000 or 2000K or 2M if you want a maximum size of 2 MB per object. It is not recommended to raise this limit above 1 MB due just to performance reasons. The default value is 1 MB.

Hope this helps./
Re: nginx+memcached: file size limits or broken images
April 25, 2012 07:10AM
First of all thanks for your reply.

My problem was different and i solved.

If i put any image to cache with java spymemcached client, nginx get broken images. After that i changed my java client to whalin memcached client.

Now i am putting images with java whalin memcached client and i can get images with nginx properly.

Regards
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 155
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