nspcc-dev / neofs-node

NeoFS is a decentralized distributed object storage integrated with the Neo blockchain
https://fs.neo.org
GNU General Public License v3.0
31 stars 38 forks source link

object/put: Use one data buffer per-request #2732

Open cthulhu-rider opened 7 months ago

cthulhu-rider commented 7 months ago

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

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:

node selects optimal buffer size and serves request within the allocated buffer. Then algorithm is simple:

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