Welcome! Log In Create A New Profile

Advanced

Re: Optimal nginx settings for websockets sending images

Maxim Dounin
March 03, 2013 07:10AM
Hello!

On Fri, Mar 01, 2013 at 11:54:06PM -0500, michael.heuberger wrote:

> thank you so much maxim
>
> i have read the documentation at
> http://nginx.org/en/docs/http/ngx_http_proxy_module.html and am trying to
> understand all that. it's not easy ...
>
> i'm serving video files (mp4 or webm). that's where these "an upstream
> response is buffered to a temporary file" warnings occur.
>
> how can i find out how far i should increase the buffers until these
> warnings are gone? how would you do this?

As long as files are big - it probably doesn't make sense to even
try to eliminate warnings by increasing buffers. Instead, you
have to derive buffer sizes from amount of memory you want to use
for buffering, keeping in mind that maximum memory will be
(proxy_buffer_size + proxy_buffers) / (worker_processes *
worker_connections).

Note: as long as you have other activity on the host in question,
including nginx with cache or even with just disk buffering, you
likely want to keep at least part of the memory free - e.g., for VM
cache.

> second problem:
> when i made changes in the css file, uploaded that, then the nginx server
> was still serving the older version. because of "proxy_cache_valid 200 302
> 304 10m;" - how can i tell nginx to refresh cache asap when a new file was
> uploaded?

While in theory you may remove/refresh file in nginx cache, it
won't really work in real life - as the same file might be cached
at various other layers, including client browser cache.

Correct aproach to the problem is to use unique links, e.g. with
version number in them. Something like "/css/file.css?42", where
"42" is a number you bump each time you do significant changes to
the file, will do the trick.

--
Maxim Dounin
http://nginx.org/en/donation.html

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Optimal nginx settings for websockets sending images

michael.heuberger February 25, 2013 10:15PM

Re: Optimal nginx settings for websockets sending images

Maxim Dounin February 26, 2013 07:32AM

Re: Optimal nginx settings for websockets sending images

michael.heuberger February 28, 2013 11:06PM

Re: Optimal nginx settings for websockets sending images

michael.heuberger February 28, 2013 11:08PM

Re: Optimal nginx settings for websockets sending images

Maxim Dounin March 01, 2013 08:00AM

Re: Optimal nginx settings for websockets sending images

michael.heuberger March 01, 2013 11:54PM

Re: Optimal nginx settings for websockets sending images

Maxim Dounin March 03, 2013 07:10AM

Re: Optimal nginx settings for websockets sending images

michael.heuberger March 03, 2013 05:37PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 130
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready