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: add support for customise output-buffer-timeout #1125

Conversation

andyxning
Copy link
Member

This PR adds support for customising server output-buffer-timeout default value.

We have encountered with a single nsqd instance with more than 40k connections. With a default 250ms output buffer timeout we have a high cpu usage. After customising it with 500ms, the CPU
usage drops about 10%.

image

@andyxning
Copy link
Member Author

/cc @mreiferson @ploxiln

@@ -117,6 +117,7 @@ func nsqdFlagSet(opts *nsqd.Options) *flag.FlagSet {
flagSet.Int64("max-rdy-count", opts.MaxRdyCount, "maximum RDY count for a client")
flagSet.Int64("max-output-buffer-size", opts.MaxOutputBufferSize, "maximum client configurable size (in bytes) for a client output buffer")
flagSet.Duration("max-output-buffer-timeout", opts.MaxOutputBufferTimeout, "maximum client configurable duration of time between flushing to a client")
flagSet.Duration("output-buffer-timeout", opts.OutputBufferTimeout, "server configurable duration of time between flushing to a client")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's rename the help text here to:

default duration of time between flushing data to clients

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mreiferson Done. PTAL.

@mreiferson
Copy link
Member

I'm OK with this, thanks for the PR @andyxning!

@mreiferson mreiferson changed the title add support for customise output-buffer-timeout nsqd: add support for customise output-buffer-timeout Jan 15, 2019
@andyxning andyxning force-pushed the add_support_for_customise_output-buffer-timeout branch from e74248e to 1de9c13 Compare January 16, 2019 01:39
Copy link
Member

@mreiferson mreiferson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mreiferson mreiferson merged commit ecd3a88 into nsqio:master Jan 16, 2019
@andyxning andyxning deleted the add_support_for_customise_output-buffer-timeout branch January 16, 2019 09:39
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.

2 participants