index segments by maximum by 2 workers #4041

This commit is contained in:
Alex Sharov 2022-05-01 09:35:18 +07:00 committed by GitHub
parent 47f492663e
commit c896807bfe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1102,8 +1102,8 @@ func DownloadAndIndexSnapshotsIfNeed(s *StageState, ctx context.Context, tx kv.R
if workers < 1 {
workers = 1
}
if workers > 4 {
workers = 4
if workers > 2 {
workers = 2 // 4 workers get killed on 16Gb RAM
}
if err := snapshotsync.BuildIndices(ctx, cfg.snapshots, cfg.snapshotDir, *chainID, cfg.tmpdir, cfg.snapshots.IndicesAvailable(), workers, log.LvlInfo); err != nil {
return err