You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I have a problem on my project that are using NSQ conccurent handler.
So I am using nsq.AddConcurrentHandlers(&MyHandler{}, 16). My project runs on 2 servers, so it means it will spawn 16 concurrent handlers from each server, with total of 32 handlers.
When one the topic depth is getting high (around 3 million), I check in nsqadmin that only 4 handlers out of 32 handlers are processing the messages. I wonder if there's any possible reason for this? since if I can get all that 32 handlers to process the messages, then there's won't be any high depth at all.
Can you show more of your handler function? How long might it take to process a message?
MaxInFlight=5000 looks too high, you want it to be between 16 and maybe 100 depending on how many nsqd you have and how long the handler typically takes to process a message.
Setting MaxAttempts and DefaultRequeueDelay to 0 are not good ideas - I think you want MaxAttempts to be 1, and Default RequeueDelay should be positive, but you can leave it at the default and requeue with backoff=false so the consumer does not backoff when the message fails.
Hi, I have a problem on my project that are using NSQ conccurent handler.
So I am using
nsq.AddConcurrentHandlers(&MyHandler{}, 16)
. My project runs on 2 servers, so it means it will spawn 16 concurrent handlers from each server, with total of 32 handlers.When one the topic depth is getting high (around 3 million), I check in nsqadmin that only 4 handlers out of 32 handlers are processing the messages. I wonder if there's any possible reason for this? since if I can get all that 32 handlers to process the messages, then there's won't be any high depth at all.
Here's my client code:
The text was updated successfully, but these errors were encountered: