-
Notifications
You must be signed in to change notification settings - Fork 493
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
Performance: 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.78% 51.68% -0.10%
==========================================
Files 644 646 +2
Lines 86697 86860 +163
==========================================
+ Hits 44894 44895 +1
- Misses 38933 39098 +165
+ Partials 2870 2867 -3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
cmd/catchpointdump/bench_report.go
Outdated
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
cmd/catchpointdump/bench.go
Outdated
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") |
cmd/catchpointdump/bench_report.go
Outdated
} | ||
|
||
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
cmd/catchpointdump/bench.go
Outdated
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.
@urtho if want to refresh this PR from master, now is a good time! |
This comment was marked as duplicate.
This comment was marked as duplicate.
Some issues to be worked out before can move forward:
|
@urtho could you remerge/fix the build and go through my comments? |
@urtho remaining failures can be tracked down/addressed by:
|
// Copyright (C) 2019-2024 Algorand, Inc. | ||
// This file is part of go-algorand | ||
// | ||
// go-algorand is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU Affero General Public License as | ||
// published by the Free Software Foundation, either version 3 of the | ||
// License, or (at your option) any later version. | ||
// | ||
// go-algorand is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU Affero General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Affero General Public License | ||
// along with go-algorand. If not, see <https://www.gnu.org/licenses/>. |
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.
double copyright, remove
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: