neofs-node
neofs-node copied to clipboard
object/put: Use one data buffer per-request
Is your feature request related to a problem? Please describe.
ObjectService.Put
devours a lot of memory for data buffers, sometimes excessively. Current scheme:
client ---> server OS
|---> gRPC
---> [slicer]
---> ObjectService
---> storage
- node process cannot affect anything up to OS overall
- no slicer when object is "ready"
each stage component of the whole processing buffers the data. This leads to redundancy leading to memory overuse
Describe the solution you'd like
allocate single buffer for the whole operation
OS |---> [xxx__buffer__xxx] ---> storage
where, in general, storage
are data drives that could be remote (depending on the client-defined storage policy)
The buffer size depends on the following factors:
- fixed amount of data specified by the client (undefined in general)
- optimal transmission unit of local and remote drives
- optimal transmission unit b/w all remote node connections
-
MaxObjectSize
- current node state
node selects optimal buffer size and serves request within the allocated buffer. Then algorithm is simple:
- read buffer from
we can start from the simplest min(MaxObjectSize, PayloadSize | Inf)
model and get rid of redundant data copies. This will already reduce resource consumption horizontally. Then we'll develop more adaptive models
Describe alternatives you've considered
not yet
Additional context
- #2686
- #2719