diff options
author | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-05-10 09:36:50 +0800 |
---|---|---|
committer | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-05-10 09:36:50 +0800 |
commit | 3874f02f1b4d00a9eed1aaf339b6877393e53785 (patch) | |
tree | ca7787dc705f04b2cc1a86ca4a8d764b485afc53 | |
parent | bd95871a89f7fdc7bd12fc5fc2c99766eb0d7c28 (diff) | |
parent | 0e211ae203935afe6478494f130a975f57261765 (diff) | |
download | go-tangerine-3874f02f1b4d00a9eed1aaf339b6877393e53785.tar go-tangerine-3874f02f1b4d00a9eed1aaf339b6877393e53785.tar.gz go-tangerine-3874f02f1b4d00a9eed1aaf339b6877393e53785.tar.bz2 go-tangerine-3874f02f1b4d00a9eed1aaf339b6877393e53785.tar.lz go-tangerine-3874f02f1b4d00a9eed1aaf339b6877393e53785.tar.xz go-tangerine-3874f02f1b4d00a9eed1aaf339b6877393e53785.tar.zst go-tangerine-3874f02f1b4d00a9eed1aaf339b6877393e53785.zip |
Merge pull request #894 from obscuren/develop
ethdb: set open file limit to 128 for all leveldbs
-rw-r--r-- | ethdb/database.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ethdb/database.go b/ethdb/database.go index 57a3f9ee6..15af02fdf 100644 --- a/ethdb/database.go +++ b/ethdb/database.go @@ -8,8 +8,11 @@ import ( "github.com/ethereum/go-ethereum/logger/glog" "github.com/syndtr/goleveldb/leveldb" "github.com/syndtr/goleveldb/leveldb/iterator" + "github.com/syndtr/goleveldb/leveldb/opt" ) +const openFileLimit = 128 + type LDBDatabase struct { fn string @@ -23,7 +26,7 @@ type LDBDatabase struct { func NewLDBDatabase(file string) (*LDBDatabase, error) { // Open the db - db, err := leveldb.OpenFile(file, nil) + db, err := leveldb.OpenFile(file, &opt.Options{OpenFilesCacheCapacity: openFileLimit}) if err != nil { return nil, err } |