diff options
author | Péter Szilágyi <peterke@gmail.com> | 2018-12-07 20:10:03 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-07 20:10:03 +0800 |
commit | d2328b604a2d4ecdccc47d8f9133593161cbd40a (patch) | |
tree | 3881283a2efd3f9051c1776d56b7db5268c054d7 /cmd | |
parent | 661809714e35f69dea23f713dd1e65cff523344c (diff) | |
parent | cf62bd2e8878d880aa9d5b20c05bb348111f6298 (diff) | |
download | dexon-d2328b604a2d4ecdccc47d8f9133593161cbd40a.tar dexon-d2328b604a2d4ecdccc47d8f9133593161cbd40a.tar.gz dexon-d2328b604a2d4ecdccc47d8f9133593161cbd40a.tar.bz2 dexon-d2328b604a2d4ecdccc47d8f9133593161cbd40a.tar.lz dexon-d2328b604a2d4ecdccc47d8f9133593161cbd40a.tar.xz dexon-d2328b604a2d4ecdccc47d8f9133593161cbd40a.tar.zst dexon-d2328b604a2d4ecdccc47d8f9133593161cbd40a.zip |
Merge pull request #18211 from karalabe/drop-fd-limit
cmd/utils: max out the OS file allowance, don't cap to 2K
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/utils/flags.go | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index d0597c2f1..6a285fcb3 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -824,17 +824,12 @@ 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 { - limit, err := fdlimit.Current() + limit, err := fdlimit.Maximum() 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 + if err := fdlimit.Raise(uint64(limit)); err != nil { + Fatalf("Failed to raise file descriptor allowance: %v", err) } return limit / 2 // Leave half for networking and other stuff } |