-
Notifications
You must be signed in to change notification settings - Fork 10.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CPU 100% with Redis Store #862
Comments
that is happening to me too. Any suggestion ? |
I'm having the same issue... single process works fine, but if I use cluster & redis store all CPUs(8) goes up to 100% My clients connects/disconnects from socket.io several times per minute (actually every time they visit a new page on my site), so maybe there is too much overhead on the pub/sub part with redis... |
Hi, When you use redis with socket.io, the server socket event "disconnet" isn't tiggered. You may inspect in the server the collection io.connected see how the connections are accumulate when you connect/disconnect again and again with a single client. It's possible that this generate a memory leak. I wrote to the socket.io author about this topic. Regards |
Experiencing the same issue here, reaches 100% CPU on all processes across 15 machines. Have to restart the system every 1-3 hours. |
I've also experienced this very consistently. Investigating. |
probably related: #686 |
Having lots of trouble with my scaled up socket.io app, and this is a good culprit. I'm having to restart my servers constantly when they're under any significant load. Screenshot of my profiler: http://i.imgur.com/AUHYX.jpg |
In deploying socket.io with RedisStore in production, it became clear that it actually makes all the app servers crash, rather than scale. One app process was barely able to serve a few hundred sockets without going into a death spiral. The more app processes added, the worse it got. After migrating everything to engine.io and using oil for rooms/broadcasting/reconnection and amino for multi-server support, I was able to handle 15k sockets easily with 5 servers. The difference was insane! I would definitely not recommend using RedisStore at all, at least in its current state. |
@carlos8f yep, I'm drastically changing RedisStore in 1.0 |
I've experienced the same problem. I think, it's caused by redis subscriptions leakage. My problem is solved for the time being, but i'm afraid that removing redis subscriptions isn't proper way to fix it. Looking forward to official changes. |
I'm also seeing this with a few hundred clients using RedisStore and Cluster. The CPU goes to 100 percent and becomes unusable. |
@daeq's hack worked for me so pub sub subscriptions looks like they are leaking |
+1 This problem did not occur until we are running live and the number of connection passes over 300. Luckily removing redis as the store solved the problem. |
Can anyone reproduce this in a development environment? I've had similar problems in production but even with considerable effort can't seem to reproduce it in a development environment, even with setting up multiple servers with RedisStore. |
See socketio/socket.io#862, 100% cpu usage
has this been fixed yet? |
I think we still have this issue at this moment 2021. My server still easy get 100% with 5k connections |
@kiennguyen07 could you please open a new issue with all necessary details? Thanks! For future readers: please note that the performance of the Redis adapter has been significantly improved over the years, I don't think there is much more we can do in terms of CPU/memory consumption. But I'm open to suggestions 🙏 |
When i use cluster & redis store, the CPU usage is easily reach 100%.
with strace, mass of these found:
what's wrong? (a few slowlog results found in redis-cli.)
when running in single process without Redis store, everything works fine.
Any recommend configuration of redis, best for socket.io? Thanks.
The text was updated successfully, but these errors were encountered: