-
Notifications
You must be signed in to change notification settings - Fork 13
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] Reduce RelayMiner memory consumption under load #739
Conversation
go.mod
Outdated
|
||
// fix upstream GHSA-h395-qcrw-5vmq vulnerability. | ||
github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.7.0 | ||
github.com/pokt-network/smt => ../smt |
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.
Contingent on pokt-network/smt#52
Overall I'm pretty happy with how relayminer performs now. There might be some goroutine leaking (not 100% sure it is even happening), but we'll find out soon enough in #742! :) This particular goroutine seems suspicious. |
The image is going to be pushed after the next commit. You can use If you also want to run E2E tests, please add |
go.mod
Outdated
|
||
// fix upstream GHSA-h395-qcrw-5vmq vulnerability. | ||
github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.7.0 | ||
// TODO_IN_THIS_PR: bump and remove |
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.
[linter-name (fail-on-found)] reported by reviewdog 🐶
// TODO_IN_THIS_PR: bump and remove
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.
@okdas Let's push to finish the SMT PR.
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.
@Olshansk requested another review there
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.
Nice one @okdas! 🚀
NOTE: I have not run the load test as I'm currently working on an underpowered machine. 😅
| application | 4 | 10 | 12 | | ||
| gateway | 1 | 10 | 3 | | ||
| supplier | 1 | 10 | 3 | |
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.
I was under the impression that the "blocks per inc" needed to be a multiple of the blocks per session param to maintain constant rates of change across various metrics as the test scales actors. I also thought that there was a check for this somewhere in the load test helpers, around the "plans".
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.
@bryanchriswhite Are you sure about this?
- If so -> can you help @okdas look into the code and find the reasoning.
- If not -> my intuition is that it keeps things simpler (to reason about) but doesn't need to be enforced.
In real life, we'll be staking / unstaking irrespective of the blocker per session so it doesn't make sense for the framework to have this limitation.
@okdas W/e the resolution ends up being, seems like the helper in the code needs a #PUC.
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.
@bryanchriswhite interesting. This check is the reason I adjusted the number - as I was getting an error. Given our current blocks per session is 10 (bumped from 4 a couple of weeks ago), what do you think should be the best value?
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.
@okdas that's the check I was referring to. 👍 I did not realize that blocks per session was 10; this all makes sense now.
pkg/relayer/session/sessiontree.go
Outdated
if err := st.treeStore.ClearAll(); err != nil { | ||
return err | ||
} | ||
// We used to `st.treeStore.ClearAll()` here, but don't need to clean up the database, causing IO load, |
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.
Great find!
go.mod
Outdated
|
||
// fix upstream GHSA-h395-qcrw-5vmq vulnerability. | ||
github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.7.0 | ||
// TODO_IN_THIS_PR: bump and remove |
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.
@okdas Let's push to finish the SMT PR.
| application | 4 | 10 | 12 | | ||
| gateway | 1 | 10 | 3 | | ||
| supplier | 1 | 10 | 3 | |
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.
@bryanchriswhite Are you sure about this?
- If so -> can you help @okdas look into the code and find the reasoning.
- If not -> my intuition is that it keeps things simpler (to reason about) but doesn't need to be enforced.
In real life, we'll be staking / unstaking irrespective of the blocker per session so it doesn't make sense for the framework to have this limitation.
@okdas W/e the resolution ends up being, seems like the helper in the code needs a #PUC.
Co-authored-by: Daniel Olshansky <[email protected]> Co-authored-by: Bryan White <[email protected]>
go.mod
Outdated
@@ -57,8 +61,8 @@ require ( | |||
// repo is the first obvious idea, but has to be carefully considered, automated, and is not | |||
// a hard blocker. | |||
github.com/pokt-network/shannon-sdk v0.0.0-20240814144717-dfa95b525d46 | |||
// TODO_IN_THIS_PR: bump after https://github.com/pokt-network/smt/pull/52 is in |
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.
[linter-name (fail-on-found)] reported by reviewdog 🐶
// TODO_IN_THIS_PR: bump after pokt-network/smt#52 is in
go.mod
Outdated
@@ -79,7 +83,11 @@ require ( | |||
gopkg.in/yaml.v2 v2.4.0 | |||
) | |||
|
|||
require golang.org/x/text v0.16.0 | |||
require ( | |||
// TODO_IN_THIS_PR: bump to the main branch commit after https://github.com/pokt-network/smt/pull/52 is in |
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.
[linter-name (fail-on-found)] reported by reviewdog 🐶
// TODO_IN_THIS_PR: bump to the main branch commit after pokt-network/smt#52 is in
The CI will now also run the e2e tests on devnet, which increases the time it takes to complete all CI checks. You may need to run GCP workloads (requires changing the namespace to 739) |
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.
🚀 🚀 🚀
One final small suggestion but otherwise this LGTM! 🚢
Co-authored-by: Bryan White <[email protected]>
## Summary ## Issue - #551 - #621 ## Type of change Select one or more: - [ ] New feature, functionality or library - [ ] Bug fix - [x] Code health or cleanup - [ ] Documentation - [ ] Other (specify) ## Testing **Documentation changes** (only if making doc changes) - [ ] `make docusaurus_start`; only needed if you make doc changes **Local Testing** (only if making code changes) - [ ] **Unit Tests**: `make go_develop_and_test` - [ ] **LocalNet E2E Tests**: `make test_e2e` - See [quickstart guide](https://dev.poktroll.com/developer_guide/quickstart) for instructions **PR Testing** (only if making code changes) - [ ] **DevNet E2E Tests**: Add the `devnet-test-e2e` label to the PR. - **THIS IS VERY EXPENSIVE**, so only do it after all the reviews are complete. - Optionally run `make trigger_ci` if you want to re-trigger tests without any code changes - If tests fail, try re-running failed tests only using the GitHub UI as shown [here](https://github.com/pokt-network/poktroll/assets/1892194/607984e9-0615-4569-9452-4c730190c1d2) ## Sanity Checklist - [ ] I have tested my changes using the available tooling - [ ] I have commented my code - [ ] I have performed a self-review of my own code; both comments & source code - [ ] I create and reference any new tickets, if applicable - [ ] I have left TODOs throughout the codebase, if applicable --------- Co-authored-by: Daniel Olshansky <[email protected]> Co-authored-by: Bryan White <[email protected]>
Summary
Issue
Type of change
Select one or more:
Testing
Documentation changes (only if making doc changes)
make docusaurus_start
; only needed if you make doc changesLocal Testing (only if making code changes)
make go_develop_and_test
make test_e2e
PR Testing (only if making code changes)
devnet-test-e2e
label to the PR.make trigger_ci
if you want to re-trigger tests without any code changesSanity Checklist