[#147] pool: Limit buffer length by 3MB in PutObject

In previous implementation we wrote up to 4KB payload chunk per-call.
This led to sending a large number of messages with a large
amount of payload.

Increase buffer length limit to 3MB.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2022-02-21 21:39:31 +03:00 committed by Kirillov Denis
parent 035f1d5667
commit 29c057272c

View file

@ -752,7 +752,7 @@ func (p *pool) PutObject(ctx context.Context, hdr object.Object, payload io.Read
}
if payload != nil {
const defaultBufferSizePut = 4096 // configure?
const defaultBufferSizePut = 3 << 20 // configure?
if sz == 0 || sz > defaultBufferSizePut {
sz = defaultBufferSizePut