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

Switched boolean flag to immediate flushing to integer #738

Merged

Conversation

andsel
Copy link
Collaborator

@andsel andsel commented Mar 4, 2023

Release notes

Introduces the ability to specify the flush interval for IO write operations, changing the default, to an immediate flush.

What does it do?

  • Changed the value of configuration setting immediate_buffer_flush from boolean to a number (expressing milliseconds)
  • Added 'buffer_flush_millis' setting which overrides the deprecated 'immediate_buffer_flush'
  • Changed default behavior from "no flush on every write" to flush on each write.
  • Used the value of the new buffer_flush_millis settings to initialize the auto flusher.

Fixes #718

Copy link
Collaborator

@hylkevds hylkevds left a comment

Choose a reason for hiding this comment

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

Looks good.
You've not updated the autoflush handler in NewNettyAcceptor yet, right?

@andsel
Copy link
Collaborator Author

andsel commented Mar 4, 2023

@hylkevds have to do, I'm going with incremental commits, to make it easy reviewable. Still work in progress, once ready I'll ask you as reviewer.

@andsel andsel marked this pull request as ready for review March 4, 2023 12:04
@andsel andsel requested a review from hylkevds March 4, 2023 12:04
@andsel andsel added the feature label Mar 4, 2023
hylkevds
hylkevds previously approved these changes Mar 4, 2023
Copy link
Collaborator

@hylkevds hylkevds left a comment

Choose a reason for hiding this comment

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

Looks good!

if (props.boolProp(BrokerConstants.IMMEDIATE_BUFFER_FLUSH_PROPERTY_NAME, true)) {
bufferFlushMillis = BrokerConstants.IMMEDIATE_BUFFER_FLUSH;
} else {
bufferFlushMillis = BrokerConstants.NO_BUFFER_FLUSH;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe it's better to default to the 1s value that used to be used when immediate_buffer_flush was false?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point, done 👍

Copy link

Choose a reason for hiding this comment

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

If you default to 1000ms people coming from Mosquitto will keep reporting bad performance

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The old immediate_buffer_flush default value is now switched from false to true.
So by default it now flushes immediatly, then if the user customize the immediate_buffer_flush to true, the flush interval is 1000ms

Copy link

Choose a reason for hiding this comment

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

You mean false I presume.immediate False = 1000; immediate true = 0. Explicit numerical value ignored if immediate is true.

@andsel andsel force-pushed the feature/congurability_of_write_flush_interval branch from 9710040 to 09ce6e2 Compare March 4, 2023 17:31
@andsel andsel merged commit b734501 into moquette-io:main Mar 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

immediate_buffer_flush should be in configuration file, defaulting to true.
3 participants