How can I set a maximum limit for gzip module?

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

How can I set a maximum limit for gzip module?

rnburn
Hello,

I'm using nginx-1.11.2 for proxy server with gzip-module.

I hope to use such like a "gzip_max_length" directive in
ngx_http_gzip_module.
Because some upstream response's sizes exceeded the settings of
gzip_buffers.
(But there were no error... These are strange things for me...)

I can change the gzip_buffers to enough size for upstream, but there is no
limit.

Can I set a limit of maximum content-size for gzip module?

Thank you.

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,273899,273899#msg-273899

_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx
Reply | Threaded
Open this post in threaded view
|

Re: How can I set a maximum limit for gzip module?

Zhang Chao
There is no any directive like “gzip_max_length” so far.
By the way, nginx compresses the body by “chunk”, so one “chunk” is an independtent compressed data.


On 27 April 2017 at 13:27:42, t.nishiyori ([hidden email]) wrote:

Hello,

I'm using nginx-1.11.2 for proxy server with gzip-module.

I hope to use such like a "gzip_max_length" directive in
ngx_http_gzip_module.
Because some upstream response's sizes exceeded the settings of
gzip_buffers.
(But there were no error... These are strange things for me...)

I can change the gzip_buffers to enough size for upstream, but there is no
limit.

Can I set a limit of maximum content-size for gzip module?

Thank you.

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,273899,273899#msg-273899

_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx

_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx
Reply | Threaded
Open this post in threaded view
|

Re: How can I set a maximum limit for gzip module?

Ruslan Ermilov
In reply to this post by rnburn
On Thu, Apr 27, 2017 at 01:27:28AM -0400, t.nishiyori wrote:

> Hello,
>
> I'm using nginx-1.11.2 for proxy server with gzip-module.
>
> I hope to use such like a "gzip_max_length" directive in
> ngx_http_gzip_module.
> Because some upstream response's sizes exceeded the settings of
> gzip_buffers.
> (But there were no error... These are strange things for me...)
>
> I can change the gzip_buffers to enough size for upstream, but there is no
> limit.
>
> Can I set a limit of maximum content-size for gzip module?
>
> Thank you.

gzip_buffers doesn't limit the maximum size of the response
that can be compressed.  When all buffers are filled, gzip
filter just outputs another chunk of compressed data.
_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx
Reply | Threaded
Open this post in threaded view
|

Re: How can I set a maximum limit for gzip module?

rnburn
Hi,

> When all buffers are filled, gzip filter just outputs another chunk of
compressed data.
Thanks for explanation about gzip-module.
When all buffers are filled, how will the next data be handled?
I think that either "wait for the buffer to be released and compressed by
gzip filter" or "output as un-compressed data".

Thank you.

[hidden email] Wrote:
-------------------------------------------------------

> On Thu, Apr 27, 2017 at 01:27:28AM -0400, t.nishiyori wrote:
> > Hello,
> >
> > I'm using nginx-1.11.2 for proxy server with gzip-module.
> >
> > I hope to use such like a "gzip_max_length" directive in
> > ngx_http_gzip_module.
> > Because some upstream response's sizes exceeded the settings of
> > gzip_buffers.
> > (But there were no error... These are strange things for me...)
> >
> > I can change the gzip_buffers to enough size for upstream, but there
> is no
> > limit.
> >
> > Can I set a limit of maximum content-size for gzip module?
> >
> > Thank you.
>
> gzip_buffers doesn't limit the maximum size of the response
> that can be compressed.  When all buffers are filled, gzip
> filter just outputs another chunk of compressed data.
> _______________________________________________
> nginx mailing list
> [hidden email]
> http://mailman.nginx.org/mailman/listinfo/nginx

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,273899,273919#msg-273919

_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx
Reply | Threaded
Open this post in threaded view
|

Re: How can I set a maximum limit for gzip module?

rnburn
In reply to this post by Zhang Chao
Hi tokers,

> nginx compresses the body by “chunk”
Thanks for explanation about gzip-module.
So, there were no errors when upstream response size exceeds the
gzip_buffers_size.
But I think a lot of large responses exceed the prepared buffers, some day.
Is there any possibility of such a problem?

Thank you.


tokers Wrote:
-------------------------------------------------------

> There is no any directive like “gzip_max_length” so far.
> By the way, nginx compresses the body by “chunk”, so one “chunk” is an
> independtent compressed data.
>
>
> On 27 April 2017 at 13:27:42, t.nishiyori
> ([hidden email])
> wrote:
>
> Hello,
>
> I'm using nginx-1.11.2 for proxy server with gzip-module.
>
> I hope to use such like a "gzip_max_length" directive in
> ngx_http_gzip_module.
> Because some upstream response's sizes exceeded the settings of
> gzip_buffers.
> (But there were no error... These are strange things for me...)
>
> I can change the gzip_buffers to enough size for upstream, but there
> is no
> limit.
>
> Can I set a limit of maximum content-size for gzip module?
>
> Thank you.
>
> Posted at Nginx Forum:
> https://forum.nginx.org/read.php?2,273899,273899#msg-273899
>
> _______________________________________________
> nginx mailing list
> [hidden email]
> http://mailman.nginx.org/mailman/listinfo/nginx
> _______________________________________________
> nginx mailing list
> [hidden email]
> http://mailman.nginx.org/mailman/listinfo/nginx

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,273899,273920#msg-273920

_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx
Reply | Threaded
Open this post in threaded view
|

Re: How can I set a maximum limit for gzip module?

Zhang Chao
Hi t.nishiyori,

Don’t worry, just like Ermilov said, when you enable the gzip module and nginx gets a part of response body, gzip module will try to compress the data, and if the buffers reach the limit, gzip module just send these compressed data firstly(ngx_http_gzip_body_filter), when processing by chunk module, they evolved a “chunk”. After some buffers is free, gzip will continue the work.


On 28 April 2017 at 16:56:06, t.nishiyori ([hidden email]) wrote:

Hi tokers,

> nginx compresses the body by “chunk”
Thanks for explanation about gzip-module.
So, there were no errors when upstream response size exceeds the
gzip_buffers_size.
But I think a lot of large responses exceed the prepared buffers, some day.
Is there any possibility of such a problem?

Thank you.


tokers Wrote:
-------------------------------------------------------

> There is no any directive like “gzip_max_length” so far.
> By the way, nginx compresses the body by “chunk”, so one “chunk” is an
> independtent compressed data.
>
>
> On 27 April 2017 at 13:27:42, t.nishiyori
> ([hidden email])
> wrote:
>
> Hello,
>
> I'm using nginx-1.11.2 for proxy server with gzip-module.
>
> I hope to use such like a "gzip_max_length" directive in
> ngx_http_gzip_module.
> Because some upstream response's sizes exceeded the settings of
> gzip_buffers.
> (But there were no error... These are strange things for me...)
>
> I can change the gzip_buffers to enough size for upstream, but there
> is no
> limit.
>
> Can I set a limit of maximum content-size for gzip module?
>
> Thank you.
>
> Posted at Nginx Forum:
> https://forum.nginx.org/read.php?2,273899,273899#msg-273899
>
> _______________________________________________
> nginx mailing list
> [hidden email]
> http://mailman.nginx.org/mailman/listinfo/nginx
> _______________________________________________
> nginx mailing list
> [hidden email]
> http://mailman.nginx.org/mailman/listinfo/nginx

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,273899,273920#msg-273920

_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx

_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx
Reply | Threaded
Open this post in threaded view
|

Re: How can I set a maximum limit for gzip module?

rnburn
Hi tokers,

I understand gzip-module that if buffers reach the limit, the module will
wait some buffers are free.
I think there is a new question the resource (such like cpu and memory) will
be over, when upstream contents are large size and lots of traffic.
I cannot set the limit of size of upstream contents. Because my nginx proxy
is handling a lot of traffic from a third party.

My nginx server which turn off the gzip-module was so fine in almost two
years. So I think there is no problem, but I am a little scared.
If I encounter this problem unfortunately, please ask you such like "Why
dose't gzip-module have a max_length directive" again.

Thank you so much.

tokers Wrote:
-------------------------------------------------------

> Hi t.nishiyori,
>
> Don’t worry, just like Ermilov said, when you enable the gzip module
> and
> nginx gets a part of response body, gzip module will try to compress
> the
> data, and if the buffers reach the limit, gzip module just send these
> compressed data firstly(ngx_http_gzip_body_filter), when processing by
> chunk module, they evolved a “chunk”. After some buffers is free, gzip
> will
> continue the work.
>
>
> On 28 April 2017 at 16:56:06, t.nishiyori
> ([hidden email])
> wrote:
>
> Hi tokers,
>
> > nginx compresses the body by “chunk”
> Thanks for explanation about gzip-module.
> So, there were no errors when upstream response size exceeds the
> gzip_buffers_size.
> But I think a lot of large responses exceed the prepared buffers, some
> day.
> Is there any possibility of such a problem?
>
> Thank you.
>
>
> tokers Wrote:
> -------------------------------------------------------
> > There is no any directive like “gzip_max_length” so far.
> > By the way, nginx compresses the body by “chunk”, so one “chunk” is
> an
> > independtent compressed data.
> >
> >
> > On 27 April 2017 at 13:27:42, t.nishiyori
> > ([hidden email])
> > wrote:
> >
> > Hello,
> >
> > I'm using nginx-1.11.2 for proxy server with gzip-module.
> >
> > I hope to use such like a "gzip_max_length" directive in
> > ngx_http_gzip_module.
> > Because some upstream response's sizes exceeded the settings of
> > gzip_buffers.
> > (But there were no error... These are strange things for me...)
> >
> > I can change the gzip_buffers to enough size for upstream, but there
> > is no
> > limit.
> >
> > Can I set a limit of maximum content-size for gzip module?
> >
> > Thank you.
> >
> > Posted at Nginx Forum:
> > https://forum.nginx.org/read.php?2,273899,273899#msg-273899
> >
> > _______________________________________________
> > nginx mailing list
> > [hidden email]
> > http://mailman.nginx.org/mailman/listinfo/nginx
> > _______________________________________________
> > nginx mailing list
> > [hidden email]
> > http://mailman.nginx.org/mailman/listinfo/nginx
>
> Posted at Nginx Forum:
> https://forum.nginx.org/read.php?2,273899,273920#msg-273920
>
> _______________________________________________
> nginx mailing list
> [hidden email]
> http://mailman.nginx.org/mailman/listinfo/nginx
> _______________________________________________
> nginx mailing list
> [hidden email]
> http://mailman.nginx.org/mailman/listinfo/nginx

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,273899,274000#msg-274000

_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx