[archiver] Try to fine-tune BoltDB parameters.

This commit is contained in:
Ciprian Dorin Craciun 2021-12-15 17:57:05 +02:00
parent b584611a06
commit d779f6093a

View file

@ -537,6 +537,7 @@ func prepareDataContent (_context *context, _pathResolved string, _pathInArchive
AbortError (_error, "[c21b0972] unexpected sources cache error!") AbortError (_error, "[c21b0972] unexpected sources cache error!")
} }
} }
_cacheBucket.FillPercent = 0.9
var _dataPreparedRaw []byte var _dataPreparedRaw []byte
if _data_0, _error := json.Marshal (_dataPrepared); _error == nil { if _data_0, _error := json.Marshal (_dataPrepared); _error == nil {
_dataPreparedRaw = _data_0 _dataPreparedRaw = _data_0
@ -630,6 +631,7 @@ func prepareDataContent (_context *context, _pathResolved string, _pathInArchive
AbortError (_error, "[b7766792] unexpected compression cache error!") AbortError (_error, "[b7766792] unexpected compression cache error!")
} }
} }
_cacheBucket.FillPercent = 0.9
if _error := _cacheBucket.Put ([]byte (_fingerprintContent), _dataCompressed); _error != nil { if _error := _cacheBucket.Put ([]byte (_fingerprintContent), _dataCompressed); _error != nil {
AbortError (_error, "[51d57220] unexpected compression cache error!") AbortError (_error, "[51d57220] unexpected compression cache error!")
} }
@ -1017,8 +1019,8 @@ func main_0 () (error) {
var _compressCacheDb *bbolt.DB var _compressCacheDb *bbolt.DB
if _compressCache != "" { if _compressCache != "" {
_options := bbolt.Options { _options := bbolt.Options {
PageSize : 16 * 1024, PageSize : 128 * 1024,
InitialMmapSize : 1 * 1024 * 1024, InitialMmapSize : 128 * 1024 * 1024,
NoFreelistSync : true, NoFreelistSync : true,
NoSync : true, NoSync : true,
} }
@ -1032,8 +1034,8 @@ func main_0 () (error) {
var _sourcesCacheDb *bbolt.DB var _sourcesCacheDb *bbolt.DB
if _sourcesCache != "" { if _sourcesCache != "" {
_options := bbolt.Options { _options := bbolt.Options {
PageSize : 16 * 1024, PageSize : 4 * 1024,
InitialMmapSize : 1 * 1024 * 1024, InitialMmapSize : 4 * 1024 * 1024,
NoFreelistSync : true, NoFreelistSync : true,
NoSync : true, NoSync : true,
} }