소스 검색

Merge pull request #1855 from calmh/dboptsagain

Reduce db write cache to (2*) 4 MiB
Audrius Butkevicius 10 년 전
부모
커밋
d1689f0012
1개의 변경된 파일2개의 추가작업 그리고 4개의 파일을 삭제
  1. 2 4
      cmd/syncthing/main.go

+ 2 - 4
cmd/syncthing/main.go

@@ -714,9 +714,7 @@ func syncthingMain() {
 func dbOpts() *opt.Options {
 	// Calculate a suitable database block cache capacity.
 
-	// Default is 8 MiB. In reality, the database will use twice the amount we
-	// calculate here, as it also has two write buffers each sized at half the
-	// block cache.
+	// Default is 8 MiB.
 	blockCacheCapacity := 8 << 20
 	// Increase block cache up to this maximum:
 	const maxCapacity = 64 << 20
@@ -743,7 +741,7 @@ func dbOpts() *opt.Options {
 	return &opt.Options{
 		OpenFilesCacheCapacity: 100,
 		BlockCacheCapacity:     blockCacheCapacity,
-		WriteBuffer:            blockCacheCapacity / 2,
+		WriteBuffer:            4 << 20,
 	}
 }