socket.io high cpu usage in production

1,037 views
Skip to first unread message

Дмитрий Пономарев

unread,
Mar 29, 2012, 12:33:25 PM3/29/12
to sock...@googlegroups.com
Hello everyone!

I'm developing a simple game based on socket.io 9.2 and latest version of node.
I currently have about 500 concurrent users playing and I ran into some problems scaling socket.io.
At first I used a single cloud server with 16 cores (12 node instances) and almost unlimited memory but after releasing to production the cpu usage started growing very fast.
Restarting node solves the problem for some time but later node eats the cpu time again. I was already using RedisStore so that was very easy to add another box with more node instances, but that did not help a lot.

Unfortunately I have no idea how to go deeper because profiling does nothing on this version of node (as far as I know) and had to stick with reloading the node as far as it eats the cpu.
According to cpu usage graphs I can only say that the cpu usage is not increasing smoothly, in a short period of time the load average goes up from <1 to more than 10.

Any ideas appreciated.

Brian Gruber

unread,
Mar 29, 2012, 1:28:39 PM3/29/12
to sock...@googlegroups.com
I can't even run it on anything above node 0.4.12 as I'll get high cpu and/or run out of memory after a while.
Have you tried it on 0.4.12?

- Brian
--
Regards,

Brian Gruber

Real time visitor analytics, chat, heatmaps & polls.

Дмитрий Пономарев

unread,
Mar 29, 2012, 3:03:23 PM3/29/12
to sock...@googlegroups.com
I guess that's not a good idea, because i'm using native node cluster and I guess that some other components won't work on this version. Anyway, i'll try.

четверг, 29 марта 2012 г. 21:28:39 UTC+4 пользователь Brian Gruber написал:
Reply all
Reply to author
Forward
0 new messages