[WebSocket] error (disconnected by server)

55 views
Skip to first unread message

Evgenii Kolesnichenko

unread,
Dec 6, 2015, 5:35:41 AM12/6/15
to nginxpushstream
Hi everybody
sometimes we get error http://joxi.ru/Y2LjjM6FnnanGr

Linux 3.2.0-4-amd64 #1 SMP Debian 3.2.65-1+deb7u1 x86_64 GNU/Linux
nginx version: nginx/1.9.4
module version: 0.5.1

could you explain why this happens (disconnecting), and what we can do.
We already change interval from 60 sec to 10, but it's not good.

Thank you

Wandenberg Peixoto

unread,
Dec 6, 2015, 9:25:21 AM12/6/15
to nginxpu...@googlegroups.com
The subscribers connections are closed by server after the connection ttl has passed.
Which value are you setting on the server?
Check if it is compatible with the behavior that you have on the client.
The interval you have changed on the client is the time that the client will wait until try to connect again.

--
You received this message because you are subscribed to the Google Groups "nginxpushstream" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nginxpushstre...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Evgenii Kolesnichenko

unread,
Dec 6, 2015, 12:08:55 PM12/6/15
to nginxpushstream


On Sunday, December 6, 2015 at 5:25:21 PM UTC+3, Wanden wrote:
The subscribers connections are closed by server after the connection ttl has passed. 
Which value are you setting on the server?
I did not set it, which parameter i need setup?
 
Check if it is compatible with the behavior that you have on the client.
The interval you have changed on the client is the time that the client will wait until try to connect again.
Yes, I understand it.

Also i looked here the same problems, and there is topic where user said that he got the same problem when trying send more than 4Kb data by websocket connection,
i decreased the amount of data and disconnecting began to occur less frequently.

Thank you for so quick answer  Wanden :)

Wandenberg Peixoto

unread,
Dec 6, 2015, 6:54:59 PM12/6/15
to nginxpu...@googlegroups.com
The configuration I mention is the push_stream_subscriber_connection_ttl directive.
The problem with messages with more than 4Kb data shouldn't be a problem anymore since the commit 312f330a01f92f7090a17d588209f970b25e86a4.
In any case I suggest you to move to the master branch (latest commit) there is at least one bug fix that can affect you if you have slow subscribers which can be worst with big messages.

Regards,
Wandenberg

Evgenii Kolesnichenko

unread,
Dec 7, 2015, 12:10:01 AM12/7/15
to nginxpushstream
Thank you
Also may be it's important,
after all changes that i have done, i opened one tab in browser, and other two developers did the same,
i and one other dev did not get reconnection, 3-rd developer get 5 reconnection during hour.

Evgenii Kolesnichenko

unread,
Dec 7, 2015, 12:58:23 AM12/7/15
to nginxpushstream
i did not set push_stream_subscriber_connection_ttl
as i see in documentation, clients connection should not be expired

Wandenberg Peixoto

unread,
Dec 7, 2015, 6:16:04 AM12/7/15
to nginxpu...@googlegroups.com
If you don't set it subscribers will not be disconnected from the server for ttl reasons.
But, if any error happens on the server (memory allocation, write socket operations, ... ) the subscriber will be disconnected.

Try the master code and let us know the results.

--

Evgenii Kolesnichenko

unread,
Dec 7, 2015, 7:48:01 AM12/7/15
to nginxpushstream
Ok thank you
Reply all
Reply to author
Forward
0 new messages