From 755e6896272697e23f530b6ef9d20865fb8f8e35 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Thu, 3 Oct 2019 14:40:14 +0200 Subject: [PATCH] lib/db: Always use small db settings on 32 bit archs (#6053) --- lib/db/lowlevel.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/db/lowlevel.go b/lib/db/lowlevel.go index d983c0ef..4e3bc9ea 100644 --- a/lib/db/lowlevel.go +++ b/lib/db/lowlevel.go @@ -267,6 +267,13 @@ func (db *Lowlevel) Close() { // dbIsLarge returns whether the estimated size of the database at location // is large enough to warrant optimization for large databases. func dbIsLarge(location string) bool { + if ^uint(0)>>63 == 0 { + // We're compiled for a 32 bit architecture. We've seen trouble with + // large settings there. + // (https://forum.syncthing.net/t/many-small-ldb-files-with-database-tuning/13842) + return false + } + dir, err := os.Open(location) if err != nil { return false