Forum: NGINX memcached_gzip_flag

Posted by tkellen (Guest)
on 2012-12-10 17:16
(Received via mailing list)
I'm running nginx 1.3.9 with memcached_pass and I have set
memcached_gzip_flag in an attempt to serve gzipped content directly from
memcached (mainly to save memory on my memcached processes, which get 
pretty
large).  My gzip flag is being detected properly--nginx adds the
Content-Encoding header--but I get 330 errors saying the content 
encoding is
incorrect.  Every test I've made indicates that the data I am storing is
valid gzipped data.  Does anyone have any advice on how to troubleshoot
this?

Thanks so much!

Posted at Nginx Forum: 
http://forum.nginx.org/read.php?2,233807,233807#msg-233807
Posted by tkellen (Guest)
on 2012-12-10 17:17
(Received via mailing list)
PS: I'm writing the data using Dalli (https://github.com/mperham/dalli) 
with
compression on and raw set to true.  Dalli sets the bitmask for 
compression
to 0x2 (all of this appears to be working correctly).

Posted at Nginx Forum: 
http://forum.nginx.org/read.php?2,233807,233808#msg-233808
Posted by Maxim Dounin (Guest)
on 2012-12-10 17:34
(Received via mailing list)
Hello!

On Mon, Dec 10, 2012 at 11:16:54AM -0500, tkellen wrote:

> PS: I'm writing the data using Dalli (https://github.com/mperham/dalli) with
> compression on and raw set to true.  Dalli sets the bitmask for compression
> to 0x2 (all of this appears to be working correctly).

As far as I can tell from [1], it stores zlib stream, not gzip
(which is a different format on top of the same compression
algorithm, see zlib.h for details).  It likely can be easily
adapted to use gzip though.

[1] https://github.com/mperham/dalli/blob/master/lib/d...

--
Maxim Dounin
http://nginx.com/support.html
Posted by Valentin V. Bartenev (Guest)
on 2012-12-10 17:34
(Received via mailing list)
On Monday 10 December 2012 20:16:54 tkellen wrote:
> PS: I'm writing the data using Dalli (https://github.com/mperham/dalli)
> with compression on and raw set to true.  Dalli sets the bitmask for
> compression to 0x2 (all of this appears to be working correctly).
>

But Dalli for compressed data uses zlib wrapper instead of gzip one.

 wbr, Valentin V. Bartenev

--
http://nginx.com/support.html
http://nginx.org/en/donation.html
Posted by tkellen (Guest)
on 2012-12-10 18:15
(Received via mailing list)
Right you are.  Thanks for the second set of eyes!  I've submitted a PR 
to
Dalli to add a gzip compressor and I'm using a custom one now.  It's 
working
wonderfully.

Posted at Nginx Forum: 
http://forum.nginx.org/read.php?2,233807,233816#msg-233816
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.