forked from TrueCloudLab/frostfs-node
[#1462] writecache: Persist objects in batches
`Update` becomes a botleneck under a heavy load. Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
6ad87e7959
commit
43e776dfb1
1 changed files with 1 additions and 1 deletions
|
@ -81,7 +81,7 @@ func (c *cache) persistSmallObjects(objs []objectInfo) {
|
||||||
cacheSize = newSize
|
cacheSize = newSize
|
||||||
}
|
}
|
||||||
|
|
||||||
err := c.db.Update(func(tx *bbolt.Tx) error {
|
err := c.db.Batch(func(tx *bbolt.Tx) error {
|
||||||
b := tx.Bucket(defaultBucket)
|
b := tx.Bucket(defaultBucket)
|
||||||
for i := 0; i < overflowIndex; i++ {
|
for i := 0; i < overflowIndex; i++ {
|
||||||
err := b.Put([]byte(objs[i].addr), objs[i].data)
|
err := b.Put([]byte(objs[i].addr), objs[i].data)
|
||||||
|
|
Loading…
Reference in a new issue