-
Notifications
You must be signed in to change notification settings - Fork 62
connection.go:265 - unable to queue heartbeat. fail now. TODO: FIXME #4
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
Comments
I'm glad to hear that go-socket.io has been useful for you so far! You are quite correct with your diagnosis. Heartbeats use the same queue as all the other messages. The current solution (= the FIXME) is less than suboptimal. I think the mechanism should give the I'm going to look into this later today. The queue length in the default configuration (= 10) might be ridiculous - I haven't given it much of a though yet. Thanks! |
I tried increasing the QueueLength to a ridiculously high number like 100k, and the issue does seem to stop. So my guess is that it IS just too many messages saturating and blocking out the heartbeats. What do you think about separating messages into one channel, and heartbeat/disconnect/handshake into like a priority channel that comes first in the select statement in the flusher? |
When you get back into this project again, can you take a look at my work on connection.go? It seems to work, in that its not backing up the heartbeats anymore. But I wanted to have you code-review it, since my Go experience is so little :-) I dont want to send a pull request until I'm confident that its good code. |
Nevermind on the broken pipe issue. It was something with the Client struct and me sending messages as strings. It was getting an "invalid argument" somehow during the Encode of the string. When I switched it to passing a struct for json marshalling it didnt have a single issue. With the fix I made, I seem to be able to run 10 concurrent clients firing at highspeed with no hiccups or disconnects. |
I have submitted a pull request that addresses this, along with some other features. |
Can you post your test client somewhere? |
Here is a stress test client I threw together: Its hard-coded to send 10k message per client, but the rest of the options are exposed as arguments. You can play with the numbers. Usage:
Example:
This would loop the whole process 5 times, connecting 10 clients each time, that each send 1000 byte messages |
Let me just start by saying thank you so much for this library. I am learning Go right now by porting a Message Server over from python (Tornado, TornadIO, ZMQ) to Go and I'm really excited by these bindings so far!
I'm hitting one of your Fix Me's in connection.go:265
c.sio.Log("sio/keepalive: unable to queue heartbeat. fail now. TODO: FIXME", c)
What I am doing is rapid fire throughput tests with a command line client. When I use only a single client, I dont hit this wall. When I run 2 concurrent connections, the messaging hangs on this for a moment and ultimately then finishes, returning these errors after all the queued messages have been delivered.
My question is mainly about what is really happening here. Does it have anything to do with the heartbeats being queued on the same channel as the messages, and they are saturating the buffer to where heartbeats cant get through? Or is it a matter of raising the queue length value?
Is it a situation where ideally the heartbeat needs to be suspended while there is actual activity?
Thanks!
-- justin
The text was updated successfully, but these errors were encountered: