Skip to content

Manually Manage Direct Write Buffer in Frozen Cache Writes (#70399) #70558

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

Merged
merged 1 commit into from
Mar 18, 2021

Conversation

original-brownbear
Copy link
Member

Manually managing the buffer has a number of upsides for us and no direct downsides
as far as I can see.

  • We limit the number of syscalls for large writes by a factor of up to 8 (in practice it's probably mostly 8 when writing larger amounts of data)
  • Since we limit the write thread count to 28 the amount of direct memory used is limited
  • We eliminate the copying from heap -> off-heap under the lock in the channel's positional write
  • We eliminate allocating ByteBuffer instances in a hot loop when writing large regions

backport of #70399

…0399)

Manually managing the buffer has a number of upsides for us and no direct downsides
as far as I can see.
* We limit the number of syscalls for large writes by a factor of up to `8` (in practice it's probably mostly `8` when writing larger amounts of data)
* Since we limit the write thread count to 28 the amount of direct memory used is limited
* We eliminate the copying from heap -> off-heap under the lock in the channel's positional write
* We eliminate allocating `ByteBuffer` instances in a hot loop when writing large regions
@original-brownbear original-brownbear added :Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs backport labels Mar 18, 2021
@elasticmachine elasticmachine added the Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. label Mar 18, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed (Team:Distributed)

@original-brownbear original-brownbear merged commit c94785c into elastic:7.x Mar 18, 2021
@original-brownbear original-brownbear deleted the 70399-7.x branch March 18, 2021 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport :Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants