Skip to content

fix: increase MAX_IOVECS limit to handle large concurrent writes #1229

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

Closed

Conversation

Daniel-Boll
Copy link
Contributor

Increase the MAX_IOVECS constant from 128 to 1024 to handle more concurrent IO operations. This fixes an issue where large updates (e.g. updating 1974 rows) would hang due to the in_flight_writes counter never reaching 0.

The original limit of 128 concurrent operations was too low for large updates, causing some write completions to be lost when the number of concurrent writes exceeded the limit. This would result in the system hanging in the WaitAppendFrames state.

By increasing the limit to 1024, we ensure that "most" writes in large update operations can be properly tracked and completed.

Increase the MAX_IOVECS constant from 128 to 1024 to handle more concurrent
IO operations. This fixes an issue where large updates (e.g. updating 1974
rows) would hang due to the in_flight_writes counter never reaching 0.

The original limit of 128 concurrent operations was too low for large
updates, causing some write completions to be lost when the number of
concurrent writes exceeded the limit. This would result in the system
hanging in the WaitAppendFrames state.

By increasing the limit to 1024, we ensure that _"most"_ writes in large
update operations can be properly tracked and completed.

Signed-off-by: Daniel Boll <danielboll.academico@gmail.com>
@@ -12,7 +12,7 @@ use std::sync::Arc;
use thiserror::Error;
use tracing::{debug, trace};

const MAX_IOVECS: u32 = 128;
const MAX_IOVECS: u32 = 1024;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think this increase in iovecs fixes anything. It just moves the point of hanging to much higher concurrency?

However, we probably should just make this configurable by introducing an UringOpts struct and passing that to UringIO::new(). We can make the default iovecs size larger too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@penberg Create the `UringOpts`, is docstrings welcomed in this case?

image

Generated some for other methods as well

image

What do you think?

Introduce `UringOpts` struct for configuring io_uring backend with
parameters like `max_iovecs` and `sqpoll_idle`. Add support for
custom options in `UringIO` initialization.

Include detailed documentation and examples.

BREAKING CHANGE: `UringIO` initialization now requires options via
`UringOpts` or defaults.

Signed-off-by: Daniel Boll <danielboll.academico@gmail.com>
@Daniel-Boll Daniel-Boll requested a review from penberg April 6, 2025 18:05
@penberg
Copy link
Collaborator

penberg commented May 15, 2025

This pull request has been marked as stale due to inactivity. It will be closed in 7 days if no further activity occurs.

@penberg penberg added the Stale label May 15, 2025
@penberg
Copy link
Collaborator

penberg commented May 22, 2025

This pull request has been closed due to inactivity. Please feel free to reopen it if you have further updates.

@penberg penberg closed this May 22, 2025
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