Skip to content
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: stats call times out requests during high load #700

Merged
merged 1 commit into from
Dec 31, 2015

Conversation

zachbadgett
Copy link
Contributor

While maxing out (reading and writing) my local nsqd with many topics (9 in this case), I noticed calling the stats api causes all requests from my consumers and producers to timeout and the stats call, if completed, takes around 14 seconds.

I believe this is caused by unneeded locking in the GetStats method. Removing the deferred and moving the RUnlock fixes the issue. During high load the stats call remained under 2ms and the consumers and producers no longer timeout. Tested with the race detector and everything looks good.

@jehiah
Copy link
Member

jehiah commented Dec 31, 2015

nice. thanks!

@jehiah jehiah added the perf label Dec 31, 2015
jehiah added a commit that referenced this pull request Dec 31, 2015
nsqd: stats call times out requests during high load
@jehiah jehiah merged commit 0bec55b into nsqio:master Dec 31, 2015
@mreiferson
Copy link
Member

😂 nice catch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants