diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 89d16b968f143e9c2f4dbf2820b14593c6940699..58bb952439adae5d9a173f5954aee755e426f0e5 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -714,13 +714,15 @@ func setIPC(ctx *cli.Context, cfg *node.Config) { // makeDatabaseHandles raises out the number of allowed file handles per process // for Geth and returns half of the allowance to assign to the database. func makeDatabaseHandles() int { - if err := fdlimit.Raise(2048); err != nil { - Fatalf("Failed to raise file descriptor allowance: %v", err) - } limit, err := fdlimit.Current() if err != nil { Fatalf("Failed to retrieve file descriptor allowance: %v", err) } + if limit < 2048 { + if err := fdlimit.Raise(2048); err != nil { + Fatalf("Failed to raise file descriptor allowance: %v", err) + } + } if limit > 2048 { // cap database file descriptors even if more is available limit = 2048 }