-
Notifications
You must be signed in to change notification settings - Fork 20.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new command line option --database-handles (#16796) #17597
Conversation
cmd/utils/flags.go
Outdated
@@ -307,6 +307,11 @@ var ( | |||
Usage: "Number of trie node generations to keep in memory", | |||
Value: int(state.MaxTrieCacheGen), | |||
} | |||
DatabaseHandles = cli.IntFlag { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
travis lint error found at this line. simply remove space, IntFlag {
to IntFlag{
will work.
This allows tuning the go-leveldb OpenFilesCacheCapacity (capacity of the open files) and thus improve performance by reducing the number of open/close syscalls.
77435e2
to
d23ad53
Compare
HackyMiner writes:
@hackmod commented on this pull request.
travis lint error found at this line. simply remove space, IntFlag { to IntFlag{ will work.
Thanks for the heads-up! I amended the commit.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't wait for the merge 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I will run some benchmarks on this an post to the PR
So here are some stats from a fast-sync, with
So the fast sync was 35% faster, which is very good (but it's just one datapoint so far). |
A full sync is also in progress, and the results so far are not showing any similar improvement. The experimental is slightly ahead (30m or so), but that slight difference may just as well be related to differences in hardware. While I guess the file handle is more of a bottleneck during fast sync, and not so much as bottleneck during full sync. |
We might be able to get similar benefits with less file handles by increasing the compaction table sizes in leveldb config. Right now the DB keeps thousands of small files and the access pattern is random so they're all accessed occasionally. |
good job!
good job! |
Could you tell me which tool can generate the graphs above? thanks |
@mrFranklin it's from datadog. We export metrics through datadog to get nice charts from our benchmarking nodes. |
Superseded by #18211, which should solve the same problem, but automagically. |
@holiman Do you have a link that document detail steps to do this? Thank you! |
This allows tuning the
go-leveldb OpenFilesCacheCapacity
option (capacity ofthe open files) and thus improve performance by reducing the number of
open/close
syscalls.By increasing the number of DB handles to 100000 I was able to reduce the number of
open/close
syscalls (10 seconds interval) significantly from:to
and thus increase the sync rate.
This Graphs shows the sync rate (Blocks/Minute) running with defaults (1024 handles) till 7:20 and
--database-handles 100000
from 7:20.