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

MM-52240: Stop/Start DB Cluster after load test #690

Merged
merged 3 commits into from
Feb 1, 2024
Merged

MM-52240: Stop/Start DB Cluster after load test #690

merged 3 commits into from
Feb 1, 2024

Conversation

agnivade
Copy link
Member

We add the ability to stop/start the DB cluster after a load-test is complete.

There is a dedicated command that the users can run any time. Additionally, there is also an automated way to stop the DB after a load test finishes, which is exposed via a flag.

Using the flag makes the load test runs synchronously, so it is advised to be used only by advanced users running the command preferably inside an EC2 instance in a screen session.

https://mattermost.atlassian.net/browse/MM-52240

We add the ability to stop/start the DB cluster after a load-test
is complete.

There is a dedicated command that the users can run any time.
Additionally, there is also an automated way to stop the DB
after a load test finishes, which is exposed via a flag.

Using the flag makes the load test runs synchronously, so it is
advised to be used only by advanced users running the command
preferably inside an EC2 instance in a screen session.

https://mattermost.atlassian.net/browse/MM-52240
@agnivade agnivade added the 2: Dev Review Requires review by a core committer label Jan 30, 2024
@agnivade agnivade changed the title Stop/Start DB Cluster after load test MM-52240: Stop/Start DB Cluster after load test Jan 30, 2024
Copy link
Member

@agarciamontoro agarciamontoro left a comment

Choose a reason for hiding this comment

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

Changes look great! I've left some comments below, but mostly questions and nits. Thank you for this!

A more general question: do we always create a DB cluster, even if we have a single DB instance? The changes here assume there's always a cluster deployed.

deployment/terraform/db_operations.go Show resolved Hide resolved
return err
}

return t.Sync()
Copy link
Member

Choose a reason for hiding this comment

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

I'm ok with the solution here, but I guess there must be a way to do this via Terraform so we can avoid the AWS command + Terraform sync 🤔

cmd/ltctl/loadtest.go Outdated Show resolved Hide resolved
cmd/ltctl/loadtest.go Outdated Show resolved Hide resolved
cmd/ltctl/loadtest.go Outdated Show resolved Hide resolved
Comment on lines +137 to +140
// Sleeping for 5 minutes gives 12 lines an hour.
// For an avg unbounded test of 4-5 hours, it gives around 50 lines,
// which should be acceptable.
time.Sleep(5 * time.Minute)
Copy link
Member

Choose a reason for hiding this comment

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

I agree it's acceptable 👍

cmd/ltctl/loadtest.go Show resolved Hide resolved
@agnivade
Copy link
Member Author

A more general question: do we always create a DB cluster, even if we have a single DB instance? The changes here assume there's always a cluster deployed.

Yep, we always create a cluster.

Copy link
Member

@agarciamontoro agarciamontoro left a comment

Choose a reason for hiding this comment

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

Sorry for being so nit-picky with the wording, it's solely for my future understanding of the logs 😂

cmd/ltctl/loadtest.go Outdated Show resolved Hide resolved
cmd/ltctl/loadtest.go Outdated Show resolved Hide resolved
Co-authored-by: Alejandro García Montoro <[email protected]>
@agarciamontoro agarciamontoro self-requested a review January 31, 2024 16:24
Copy link
Member

@agarciamontoro agarciamontoro left a comment

Choose a reason for hiding this comment

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

Thank you! 🚀

Copy link
Member

@isacikgoz isacikgoz left a comment

Choose a reason for hiding this comment

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

LGTM, just a question

break
}
fmt.Println("Sleeping... ")
time.Sleep(30 * time.Second)
Copy link
Member

Choose a reason for hiding this comment

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

Isn't 30 second too much for the ping interval?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not really. These take a long time to stop or start. In the order of ~5 minutes.

@agnivade agnivade added 4: Reviews Complete All reviewers have approved the pull request and removed 2: Dev Review Requires review by a core committer labels Feb 1, 2024
@agnivade agnivade merged commit 46d0be8 into master Feb 1, 2024
1 check passed
@agnivade agnivade deleted the stopDB branch February 1, 2024 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4: Reviews Complete All reviewers have approved the pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants