I am developing publishing functions for my site using socket.io on a node server. I had problems for the last month or so, when socket connections became painfully slow or did not respond at all after several days of work. There is not enough memory on the server. I'm not good at debugging this kind of problem.
The socket.io logs didn’t tell me much more than “the connection to the website is invalid” or the client “client is not set up” must reconnect “”
I ran into googled and eventually saw a thread recommending running netstat on the command line, and saw a large number of connections in FIN_WAIT2 and CLOSE_WAIT and realized that this was the cause of my problem. After viewing some threads in socket.io, github is recommended to upgrade to 0.9.14 branch (at that time I was working with 0.9.13).
Since then I have done this, and I still have periods of “downtime” when the server is only running for several days in a row. My site is not approaching the amount of traffic where this should be a problem.
A new error appeared in my logs (websocket parser error: no handler for opcode 10), but my search on Google started to work. I’m not sure where to turn to solve this problem, or if I’m just after a red herring and the real problem is something else that one of you can help me shed some light.
I am running node.js v0.10.10 and using socket.io v0.9.14. A hard reboot of the linux server will solve the problem in 100% of cases, while restarting the node service does not cause, which led me to the fact that this is a problem related to open sockets on the server.
source share