mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-03 23:20:25 +08:00
调整pebble相关参数
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/TeaOSLab/EdgeNode/internal/events"
|
"github.com/TeaOSLab/EdgeNode/internal/events"
|
||||||
|
"github.com/TeaOSLab/EdgeNode/internal/utils"
|
||||||
"github.com/cockroachdb/pebble"
|
"github.com/cockroachdb/pebble"
|
||||||
"github.com/iwind/TeaGo/Tea"
|
"github.com/iwind/TeaGo/Tea"
|
||||||
"io"
|
"io"
|
||||||
@@ -89,7 +90,13 @@ func (this *Store) Open() error {
|
|||||||
Logger: NewLogger(),
|
Logger: NewLogger(),
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO 需要修改 BytesPerSync 和 WALBytesPerSync 等等默认参数
|
var memoryMB = utils.SystemMemoryGB() * 1
|
||||||
|
if memoryMB > 256 {
|
||||||
|
memoryMB = 256
|
||||||
|
}
|
||||||
|
if memoryMB > 4 {
|
||||||
|
opt.MemTableSize = uint64(memoryMB) << 20
|
||||||
|
}
|
||||||
|
|
||||||
rawDB, err := pebble.Open(this.path, opt)
|
rawDB, err := pebble.Open(this.path, opt)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user