aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/utils
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2018-11-29 18:47:29 +0800
committerPéter Szilágyi <peterke@gmail.com>2018-11-29 18:47:29 +0800
commitcf62bd2e8878d880aa9d5b20c05bb348111f6298 (patch)
tree5946a65b9ddba0bedd7ec4321b77d511fa4a3a3a /cmd/utils
parent01371469e60ead5c442cefb71351583aabb1fc82 (diff)
downloaddexon-cf62bd2e8878d880aa9d5b20c05bb348111f6298.tar
dexon-cf62bd2e8878d880aa9d5b20c05bb348111f6298.tar.gz
dexon-cf62bd2e8878d880aa9d5b20c05bb348111f6298.tar.bz2
dexon-cf62bd2e8878d880aa9d5b20c05bb348111f6298.tar.lz
dexon-cf62bd2e8878d880aa9d5b20c05bb348111f6298.tar.xz
dexon-cf62bd2e8878d880aa9d5b20c05bb348111f6298.tar.zst
dexon-cf62bd2e8878d880aa9d5b20c05bb348111f6298.zip
cmd/utils: max out the OS file allowance, don't cap to 2K
Diffstat (limited to 'cmd/utils')
-rw-r--r--cmd/utils/flags.go11
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
}