-
-
Notifications
You must be signed in to change notification settings - Fork 64
Websocket connections not closed using Kong load balancer #83
Comments
Don't know anything about Kong 🤷🏻♂️
Preferably, you should use "least open connections" for WebSockets; that would result in more uniform balancing. But as I see here:
Anyway, that shouldn't be the reason for this issue. As far as I understand, WebSockets load balancing works the following way:
What could go wrong? I have two ideas:
Do you know how to reproduce this setup locally? Maybe, via |
Thanks for your answer. regarding the tcp keepalive settings:
as far as I understand this means a websocket connection shoul be closed after 2 hours if all 9 request probes fail. So there should be a reduction of connections somewhen if this woud work. right? Here the graph from the weekend with less traffic: I'll add a graph of normal operation to my original question |
We had something similar on project with such scheme:
Issue was Also, check that you don't have Maybe it will help you @RolandG |
Thanks for the tip. We didn't have the issue since we have activated again the orange cloud in cloudflare. We had it deactivated before because we had performance problems with it. Since then the connections are closed at a certain point from cloudflare I gues. Still we might need this in the future. |
@le0pard |
@RolandG it is params for Linux kernel - https://wiki.archlinux.org/index.php/sysctl Was globally available for all processes on the system |
@le0pard at which layer you made the sysctl change? the Nginx or Anycable one? |
@scalp42 sysctl changes was made on system/OS level. |
@le0pard right but on which host? the Nginx one or Anycable host? |
It was the same host in my case @scalp42 |
Hi, guys The anycable-go server is behind the Nginx reverse proxy and according to ngx_http_stub_status_module (http://nginx.org/en/docs/http/ngx_http_stub_status_module.html) I see near 80 active connections that look close to reality for that period of time for my app. But at the same time And On the other hand when I restart the Nginx, the I tried to tune OS keepalive settings as described in the official doc https://docs.anycable.io/#/v1/anycable-go/os_tuning?id=tcp-keepalive but nothing changes, I checked that I also tried the libkeepalive library (http://libkeepalive.sourceforge.net) as described in Could you advise please what may be wrong? I would be appreciated for any help |
Tell us about your environment
AnyCable-Go version:
v0.6.3
AnyCable gem version:
v0.6.3
What did you do?
Use kong as a load balancer.
What did you expect to happen?
Websocket connections are closed after some time.
What actually happened?
Websocket connections add up very fast until kong reaches its limit (8-10k) and restarts with
Before kong we used the native kubernetes nginx as a load-balancer and the connections got closed properly. We usually had around 1k connections at peak times.
First we thougt the problem was that sticky sessions were not working properly. This problem should be fixed but we still see the same issue. (first bump in the picture is before we used sticky sessions hash_on: ip)
EDIT: a graph from before we were using kong:
Are there any special settings that need to be set in load-balancer?
Any other idea how to resolve that problem?
Thank You
The text was updated successfully, but these errors were encountered: