mirror of
https://github.com/nspcc-dev/neofs-node.git
synced 2026-03-01 04:29:10 +00:00
Reuse object/data memory for replication workers #1012
Labels
No labels
I1
I2
I3
I4
S0
S1
S2
S3
S4
U0
U1
U2
U3
U4
blocked
bug
config
dependencies
discussion
documentation
enhancement
enhancement
epic
feature
go
good first issue
help wanted
neofs-adm
neofs-cli
neofs-cli
neofs-cli
neofs-ir
neofs-lens
neofs-storage
neofs-storage
performance
question
security
task
test
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nspcc-dev/neofs-node#1012
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @roman-khimov on GitHub (Apr 24, 2023).
Is your feature request related to a problem? Please describe.
I'm always frustrated when I'm looking at the replication worker code. It takes and object from the storage, decompresses it, unmarshals it and then pushes the result to some other node. It allocates for the raw data, it allocates for the decompressed data, it allocates for the object and all of its fields. For big objects this means a heck of a lot of allocations.
Describe the solution you'd like
Have one per-replicator data buffer for raw data, one for decompressed data, one object. Reuse them. Likely this is not supported by our APIs at the moment, but this can probably be changed.
Additional context
#2300/#2178
@cthulhu-rider commented on GitHub (Feb 21, 2024):
i suggest to start from size-segmented sync pool as more simple approach
in current situation, when worker 1:1 individual object, per-worker static buffer residence could lead us to bad memory utilization with large dispersion of objects up to 64M. It is worth thinking about the adaptive size of this buffer. For example:
S(e.g. 256K)MISS(quantity or excess average)MISSexceeds the specified limit, the buffer grows (e.g. doubled or +average)For this approach to be effective, a more adaptive work queue may be needed. To me, in this approach complexity could be above efficiency
an alternative approach could be a replication batch: all Policer workers pack to-be-replicated objects into a single limited buffer which is flushed after filling or by a timer. IMO managing the batch size will be simpler and more efficient than current tuning of worker pool capacity which relies only on incoming traffic and not outgoing. Per-node batches would allow background replication to be correlated with external traffic (PUT) and simplify prioritization model