gno
gno copied to clipboard
chore: Add misc/stress-test
This PR adds a Go utility in misc/stress-test/stress-test-many-posts which adds millions of posts to the (local) boards realm to test how memory and transaction time change with lots of realm storage. See the README for how to use it. See this report for example graphs created from using this utility.
Great stuff!
Interim results with gnoland
Here are some results with gnoland (on-disk storage) where the max allowed gas was increased for adding 500 posts each transaction. The stress test added a million posts.
On average, it took 5 seconds to add 500 posts. This remained fairly constant. (I was testing this on my working Mac. The extra time during 600 000 and 700 000 was because my browser was temporarily using a lot of memory. This wouldn't happen on a dedicated node.) Here is the gnoland memory usage:
It uses a baseline 330 MB RAM for zero posts and 418 MB RAM for one million posts, with fairly linear increase. That's 88 bytes per post, which is much more reasonable than 20 000 bytes per post for in-memory storage. When gnodev supports on-disk storage, we'll repeat this experiment using it.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 60.21%. Comparing base (
8bd07c9
) to head (ec5a336
).
Additional details and impacted files
@@ Coverage Diff @@
## master #1583 +/- ##
==========================================
- Coverage 60.21% 60.21% -0.01%
==========================================
Files 561 561
Lines 75071 75071
==========================================
- Hits 45205 45201 -4
- Misses 26485 26490 +5
+ Partials 3381 3380 -1
Flag | Coverage Δ | |
---|---|---|
contribs/gnodev | 61.40% <ø> (ø) |
|
contribs/gnofaucet | 14.46% <ø> (-0.86%) |
:arrow_down: |
gno.land | 64.75% <ø> (ø) |
|
misc/genstd | 80.54% <ø> (ø) |
|
misc/logos | 19.88% <ø> (-0.36%) |
:arrow_down: |
tm2 | 61.95% <ø> (-0.07%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@jefft0 what's the status on this PR? Do you need feedback or directions of how to move forward?
@jefft0 what's the status on this PR? Do you need feedback or directions of how to move forward?
I'm still settling on the best way to run the tests. Right now it uses a clone of r/demo/boards running on a local gnoland. The clone is needed to fix this problem.
Also, it's necessary to rebuild gnoland with a hack to increase the MaxGas so that more operations can be done per transaction to stuff data into the node. Otherwise it takes forever. Can MaxGas be configured on the command line to start gnoland? (It has -genesis-max-vm-cycles
but this doesn't prevent the "invalid gas" error.)
Should this PR be merged if it needs hacks like this to get it running?
(It has
-genesis-max-vm-cycles
but this doesn't prevent the "invalid gas" error.)
It currently doesn't do anything, because NewApp in gno.land/pkg/gnoland/app.go
doesn't have cfg.MaxCycles = maxCycles
. (lol).
I'm making a PR to fix that, but I wanted to add the unused-param linter to avoid this happening again, and I'm now in a rabbit hole. In any case, thought I'd mention this here so you can at least sort it out with a patch on your side. (Or use gnodev, which shouldn't have this issue)
Should this PR be merged if it needs hacks like this to get it running?
No, fair point. Let's wait on the outstanding issues. It may also be nice, for this PR specifically, to add instructions in a README on how to run the stress test. Let's re-consider how to add this after fixing max-vm-cycles and the GetOrigCaller issue.
Hi @thehowl . Thanks to the merging of https://github.com/gnolang/gno/pull/2358, this utility doesn't need hacks to run. I added a README and changed from Draft to Read to Review.