-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
nsqd: message stalling with Snappy enabled #532
Comments
hey @amattn Can you paste the code you're using to configure the |
Thanks! Here's our settings: config.HeartbeatInterval was higher, but we dropped it down to 3 seconds as a temporary workaround for force flushing.
|
Here are the two settings that affect buffering: https://github.com/bitly/go-nsq/blob/master/config.go#L92-L99 You shouldn't (ever) see a delay that's longer than
|
It's possible this has something to do with Can you try disabling |
Fixed! Is this a snappy bug? For now we'll disable snappy and possibly try out deflate. Any other recommendations? |
I don't think it's a |
(updated title) |
@amattn is there some easy test case/code/app I can use to debug this? I'm having trouble reproducing 😞 |
I’ll see if I can reproduce in a test system… |
I also meet this problems https://github.com/nsqio/go-nsq/blob/master/protocol.go line 61
this code can not read full message, it's waiting for reading. also that, I replace nsqd's and consumer's snappy with google's snappy, it ok Just replacing the consumer's snappy code is correct too. |
@lauyoume thanks for the tip! I've opened #830 to handle this. I think it's good to defer to official "golang" packages when possible anyway! |
Hi,
Root problem:
Most of the messages that go through our system do so rapidly (tens or hundreds of milliseconds) but some messages stall for multiple seconds. The length of the stall is tied to the nsqd client heartbeat.
The stalled messages don't really stand out (roughly 6k of json). We send other large messages that don't seem to stall.
My own investigation so far suggests that this area of the code in
protocol_v2.go
is related:Specifically, I believe that certain messages aren't being flushed properly. The heartbeat hits the client and then that flushes the stalled messages through.
Have you seen this behavior before?
Is there any reason that a message might get stuck in util.SendFramedResponse?
Is there a reason we don't explicitly flush frameTypeMessage?
The text was updated successfully, but these errors were encountered: