Skip to content

Apply client write deadline to batches rather than total flushes#6471

Merged
derekcollison merged 1 commit intomainfrom
neil/iovdeadline
Feb 7, 2025
Merged

Apply client write deadline to batches rather than total flushes#6471
derekcollison merged 1 commit intomainfrom
neil/iovdeadline

Conversation

@neilalexander
Copy link
Copy Markdown
Member

By calculating the write deadline at the beginning of the flush operation, we could be hitting it early if there is a lot of data queued up. Instead this PR applies it to each writev batch of at most 1024 vectors, which means that the deadline applies to no more than 64MB in one go.

This makes it simpler to tune the write deadline as it can be thought of as "the maximum time taken to allow writing at most 64MB" instead.

Signed-off-by: Neil Twigg neil@nats.io

By calculating the write deadline at the beginning of the flush operation,
we could be hitting it early if there is a lot of data queued up. Instead
this PR applies it to each `writev` batch of at most 1024 vectors, which
means that the deadline applies to no more than 64MB in one go.

This makes it simpler to tune the write deadline as it can be thought of
as "the maximum time taken to allow writing at most 64MB" instead.

Signed-off-by: Neil Twigg <neil@nats.io>
@neilalexander neilalexander requested a review from a team as a code owner February 7, 2025 16:06
Copy link
Copy Markdown
Member

@derekcollison derekcollison left a comment

Choose a reason for hiding this comment

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

LGTM

@derekcollison derekcollison merged commit aeaa12f into main Feb 7, 2025
@derekcollison derekcollison deleted the neil/iovdeadline branch February 7, 2025 16:25
neilalexander added a commit that referenced this pull request Feb 10, 2025
Includes the following:

- #6465
- #6464
- #6469
- #6471
- #6472
- #6474
- #6477
- #6480
- #6487
- #6488

Signed-off-by: Neil Twigg <neil@nats.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants