Welcome! Log In Create A New Profile

Advanced

Re: Optimal nginx settings for websockets sending images

Maxim Dounin
February 26, 2013 07:32AM
Hello!

On Mon, Feb 25, 2013 at 10:15:55PM -0500, michael.heuberger wrote:

> The recent nginx 1.3.13 websocket support is fantastic! Big thanks to the
> nginx devs, it works like a charm.

Good to hear. :)

> I only have performance issues. Sending images through websockets turns out
> to be difficult and slow. I have a website sending 5 images per seconds to
> the server.
>
> Sometimes I have warnings like "an upstream response is buffered to a
> temporary file", then sometimes it's lagging and the server isn't that
> fast.

This messages are not related to websocket connections, as
websocket connections doesn't do any disk buffering and only use
in-memory buffers. (More specifically, a connection uses two
in-memory buffers with size of proxy_buffer_size - one for
backend-to-client data, and one for client-to-backend data.)

Given the above, I would suppose that you actually have
performance problems unrelated to websockets.

> I'm not sure if my settings for this scenario are optimal. Below you will
> find extracts of my nginx conf files. Maybe you spot some mistakes or have
> suggestions?

[...]

> proxy_buffers 8 2m;
> proxy_buffer_size 10m;
> proxy_busy_buffers_size 10m;

Buffers used looks huge, make sure you have enough memory.

> proxy_cache one;
> proxy_cache_key "$request_uri|$request_body";

Usuing request body as a cache key isn't really a good idea unless
all request bodies are known to be small.

[...]

--
Maxim Dounin
http://nginx.com/support.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: 178
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