Skip to content

Commit

Permalink
增大日志文件的最大大小 允许更大的事务 (PaddlePaddle#1350)
Browse files Browse the repository at this point in the history
* 增大日志文件的最大大小 允许更大的事务

* 增大日志文件的最大大小 允许更大的事务
  • Loading branch information
luoyuedong authored Jul 24, 2024
1 parent 18f3c59 commit a9a1064
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ require (
)

require (
github.com/BurntSushi/toml v0.4.1 // indirect
github.com/BurntSushi/toml v1.4.0 // indirect
github.com/Microsoft/go-winio v0.5.0 // indirect
github.com/PuerkitoBio/purell v1.1.1 // indirect
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbt
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/toml v0.4.1 h1:GaI7EiDXDRfa8VshkTj7Fym7ha+y8/XxIgD2okUIjLw=
github.com/BurntSushi/toml v0.4.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0=
github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/D0m021ng/apis v1.3.0-k8s1.19.6-21e223 h1:To0iOQD/rKFN/TvzRZVtK45xPP0GNnMwq2rLQ++RA4A=
github.com/D0m021ng/apis v1.3.0-k8s1.19.6-21e223/go.mod h1:UaeJ/s5Hyd+ZhFLc+Kw9YlgM8gRZ/5OzXqHa0yKOoXY=
Expand Down
8 changes: 6 additions & 2 deletions pkg/fs/client/kv/badger.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ func NewBadgerClient(config Config) (KvClient, error) {
var err error
if config.Driver == MemType {
Options := badger.DefaultOptions("")
Options.MemTableSize = 4 << 20
Options.ValueLogFileSize = 1024 << 20 // 设置为 1 GB
Options.MemTableSize = 128 << 20
Options.ValueThreshold = 1 << 20 / 4
db, err = badger.Open(Options.WithInMemory(true))
} else if config.Driver == DiskType {
Expand All @@ -54,7 +55,10 @@ func NewBadgerClient(config Config) (KvClient, error) {
Options.BaseTableSize = 2 * 1024 * 1024
db, err = badger.Open(Options)
} else {
db, err = badger.Open(badger.DefaultOptions(config.CachePath))
Options := badger.DefaultOptions(config.CachePath)
Options.BaseTableSize = 128 << 20 // 设置为 128 MB
Options.ValueLogFileSize = 1024 << 20 // 设置为 1 GB
db, err = badger.Open(Options)
}

} else {
Expand Down

0 comments on commit a9a1064

Please sign in to comment.