-
Notifications
You must be signed in to change notification settings - Fork 479
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
Node benchmarking utility #6198
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6198 +/- ##
==========================================
- Coverage 51.85% 51.74% -0.11%
==========================================
Files 639 641 +2
Lines 85508 85676 +168
==========================================
- Hits 44336 44335 -1
- Misses 38356 38524 +168
- Partials 2816 2817 +1 ☔ View full report in Codecov by Sentry. |
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.
Good work! I left few comments.
The PR will need an update after #6177 gets merged.
return fmt.Sprintf(">> stage:%s duration_sec:%.1f duration_min:%.1f cpu_sec:%d", bs.stage, bs.duration.Seconds(), bs.duration.Minutes(), bs.cpuTimeNS/1000000000) | ||
} | ||
|
||
func maybeGetTotalMemory() uint64 { |
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.
consider moving to util/util.go
benchCmd.Flags().IntVarP(&round, "round", "r", 0, "Specify the round number ( i.e. 7700000 )") | ||
benchCmd.Flags().StringVarP(&relayAddress, "relay", "p", "", "Relay address to use ( i.e. r-ru.algorand-mainnet.network:4160 )") | ||
benchCmd.Flags().StringVarP(&catchpointFile, "tar", "t", "", "Specify the catchpoint file (either .tar or .tar.gz) to process") | ||
benchCmd.Flags().StringVarP(&reportJsonPath, "report", "j", "", "Specify the file to save the Json formatted report to") |
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.
benchCmd.Flags().StringVarP(&reportJsonPath, "report", "j", "", "Specify the file to save the Json formatted report to") | |
benchCmd.Flags().StringVarP(&reportJsonPath, "report", "j", "", "Specify the file to save the JSON formatted report to") |
} | ||
|
||
func GetCPU() int64 { | ||
usage := new(syscall.Rusage) |
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.
same, move to util
addrs = []string{relayAddress} | ||
} else { | ||
//append relays | ||
dnsaddrs, err := tools.ReadFromSRV(context.Background(), "algobootstrap", "tcp", networkName, "", false) |
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.
"algobootstrap" probably should not be here since they not obliged to have catchpoints except few most recent ones.
go-algorand could use a standardized way to compare and benchmark the underlying hardware, ideally with a repeatable workload that closely matches a real scenario.
Users could compare their results online and make sure their hardware's performance is above the median so that network peak performance can grow with the number of new nodes.
The catchpointdump utility is the perfect first candidate for such a utility.
This patch adds a
bench
command to the utility by combining both network and file restore scenarios. Download, SQLite loading and Merkle tree build can be benchmarked all in one go.It reuses some of the dependencies that are already in go.mod to get information about the hardware - at least on the Linux platform.
Results are optionally dumped to a JSON file and ready for submission to some central benchmark repository.
Examples
Simple Network, SSD and CPU test
Known catchpoint label, sourced from a random relay/archiver :
SSD and CPU test with local file
Benchmarking the disk and CPU part only using the already downloaded ledger snapshot:
Full benchmark with JSON report and hosted snapshot
A repeatable benchmark with a CloudFlare hosted catchpoint and report dump
Report file
Sample report.json:
File can be uploaded to a 3rd pty benchmark site like: