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
It seems that the default RDY for the cosumer connection is always 1, in spite of the "cocurrency" that set by the "AddConcurrentHandlers" method, consequently, the messages can only be sent to one handler goroutine at the same time, other goroutines has to wait, until the "FIN" is sent for the read message.
To resolve this situation, it has to manually call the "ChangeMaxInFlight" method, then all of the handler goroutines can receive messages (if they're in the queue ) at the same time.
The text was updated successfully, but these errors were encountered:
@chaosue You are correct. MaxInFlight (which controls the RDY count each individual connection to a nsqd instance gets and the total number of messages you can have outstanding at any point in time) is independent of the concurrency control.
This is by design.
Since nsqd operates on a push basis (nsqd pushes messages to clients), MaxInFlight allows you to oversubscribe to eliminate latency. If for example you had MaxInFlight=2 but concurrency=1, while processing 1 message nsqd could send the "next" message over the wire so it's ready to be processed instantly after the first one is completed. Without oversubscribing you would have to wait a round trip time between client finishing, sending the response and then getting the next message. This would undesirably limiting throughput in some situations, especially high latency ones.
It seems that the default RDY for the cosumer connection is always 1, in spite of the "cocurrency" that set by the "AddConcurrentHandlers" method, consequently, the messages can only be sent to one handler goroutine at the same time, other goroutines has to wait, until the "FIN" is sent for the read message.
To resolve this situation, it has to manually call the "ChangeMaxInFlight" method, then all of the handler goroutines can receive messages (if they're in the queue ) at the same time.
The text was updated successfully, but these errors were encountered: