Skip to content
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

[morpheus/token] vm limit cpu & disk usage #314

Merged
merged 2 commits into from
Aug 3, 2023

Conversation

najeal
Copy link
Contributor

@najeal najeal commented Jul 31, 2023

Fixes #312

It looks weird to use 100000 CPUs. I also deleted disk value to use the default one.

@najeal najeal requested a review from patrick-ogrady as a code owner July 31, 2023 21:24
@patrick-ogrady
Copy link
Contributor

patrick-ogrady commented Aug 1, 2023

I agree that we should make the number of nodes configurable (use args when running the program from the run script rather than hardcoding the change).

You should avoid modifying the rate limit configs (those don't actually use/preallocate any CPU/disk). They just prevent the rate limiter from being active (not needed on a local network and can cause instability during stress tests -> still need to figure out recommended numbers for production).

@najeal
Copy link
Contributor Author

najeal commented Aug 1, 2023

Configuring with less node generates error woth not enough amount staked. The only stuff related to the consensus I have seen for changing required staked amount is k and alpha parameters.

@patrick-ogrady
Copy link
Contributor

patrick-ogrady commented Aug 1, 2023

Configuring with less node generates error woth not enough amount staked. The only stuff related to the consensus I have seen for changing required staked amount is k and alpha parameters.

I'm just referring to making the hardcoded values I have in the e2e tests (

for i := 1; i <= 10; i++ {
) a variable ( ).

The consensus parameters are agnostic to the number of nodes actually in the subnet. You shouldn't have to modify any such params.

@najeal
Copy link
Contributor Author

najeal commented Aug 2, 2023

This configures the subnets, but I would like to configure also the anrCli.Start() with a runner_sdk.WithNumNodes().

@patrick-ogrady
Copy link
Contributor

This configures the subnets, but I would like to configure also the anrCli.Start() with a runner_sdk.WithNumNodes().

I wouldn't worry about that for now. They aren't really doing anything in the background here and should have very minimal CPU/RAM usage.

If you still want to change that to "1" or something, you still wouldn't need to modify any consensus params.

@najeal najeal force-pushed the limit-cpu-disk-usage branch from 2d45368 to 5b2b251 Compare August 2, 2023 23:35
@najeal
Copy link
Contributor Author

najeal commented Aug 2, 2023

@patrick-ogrady used vars as you suggested.

&numValidators,
"num-validators",
5,
"number of validators by blockchain",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: per

&numValidators,
"num-validators",
5,
"number of validators by blockchain",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: per

@@ -226,7 +235,7 @@ var _ = ginkgo.BeforeSuite(func() {

// Name 5 new validators (which should have BLS key registered)
subnet := []string{}
for i := 1; i <= 5; i++ {
for i := 1; i <= int(numValidators); i++ {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: error if 0

Copy link
Contributor Author

@najeal najeal Aug 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

going to check input is > 0

@@ -221,9 +230,9 @@ var _ = ginkgo.BeforeSuite(func() {
// Name 10 new validators (which should have BLS key registered)
subnetA := []string{}
subnetB := []string{}
for i := 1; i <= 10; i++ {
for i := 1; i <= int(numValidators)*2; i++ {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: error if 0

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

going to check input is > 0

@patrick-ogrady
Copy link
Contributor

@patrick-ogrady used vars as you suggested.

Few nits but otherwise looks great

@@ -165,6 +165,7 @@ var _ = ginkgo.BeforeSuite(func() {
gomega.Equal(modeFullTest),
gomega.Equal(modeRun),
))
gomega.Expect(numValidators).Should(gomega.BeNumerically(">", 0))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even better. Nice!

@patrick-ogrady patrick-ogrady merged commit eaccec7 into ava-labs:main Aug 3, 2023
@najeal najeal deleted the limit-cpu-disk-usage branch August 3, 2023 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable [morpheus/token]vm running with less nodes/resources
2 participants