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

wsgi tuning setup config #1947

Merged
merged 5 commits into from
Oct 11, 2023
Merged

wsgi tuning setup config #1947

merged 5 commits into from
Oct 11, 2023

Conversation

JenniWhitman
Copy link
Contributor

What are the relevant tickets?

Updates #1682

Description (What does it do?)

Installs uwsgitop which we'll need on rc to run this
has instructions and an example file to set up locust locally which will be used to generate both local and RC traffic

How can this be tested?

Using the information provided, get locust running and sending requests to your local application and rc - if you can use this to set it up, I've done my job.

Additional Context

This is essentially this: mitodl/ocw-studio#1898 with a little more information around the locust setup

@JenniWhitman
Copy link
Contributor Author

I will say the only reason the locustfile.py is here right now is so locust starts (you need a valid user). Don't worry about the test passing, not, etc - just make sure you can load it and stuff happens when you hit the button :) We'll critique the test itself in the last PR

@@ -126,3 +126,4 @@ celerybeat-schedule
docker-compose.*.yml

.python-version
/locustfile.py
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is just so that when we DO add locustfiles, they don't accidentally go to prod - locust won't run without one, so we won't accidentally... ddos production somehow?

@@ -0,0 +1,92 @@
import logging
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Again - we're not looking at this with heavy scrutiny yet (or ever really - adjust this to your needs - this is just what I'm using this time around). But feel free to take a look and check out the output as things run (yes, 2 endpoints are angry and I'm still deciding what to do about it)

@annagav annagav self-requested a review October 10, 2023 13:25
@annagav annagav self-assigned this Oct 10, 2023
@ibrahimjaved12
Copy link

It seems a very user-friendly guide. I gave it a quick peek. Here's a few points I thought:

  • Nice details on the example file! You even added a wait_time which would also remind anyone testing that we can also use this to slightly modify the testing params.
  • We should also should think about RC vs Local dev in terms of loadtesting + running uwsgi monitor and clarify which thing's for what. Like the general plan + difference in commands (if any). Which things we will have in local dev/RC which will not, stating that for the overall guide in .rst.
  • The end goal is testing RC. But before that we will be testing local dev first
    • The way I did it, through Locust integrated with local dev -- by running local dev server -- I load tested RC. I see that you're writing a very detailed guide, so things like this might be helpful to include as it could be confusing for someone to understand that from local dev changes we'd be actually testing RC as well (because the locustfile -- it actually stays in local dev and its in gitignore). I see that this is already part of the PR in under testing instructions - do you think it might also be useful to include such information regarding load testing mitxonline in the .rst file? (I think it might be part of the section -- to test -- in that guide which is incoming), but still mentioning just to be sure.
      Also for the testing part, I think it would be good if we also consider CLI testing/ check if it will be useful for our case. This way we could get like consistent results.
      • We could also write a little script of sorts that compares the results and gives us the information we want, but that's extra and maybe a little out of scope. Just thinking of the possibilities.
    • The locust example file kind of reflects the local dev testing (from the login perspective). I think mitxonline RC login would be probably different from that? I know that I had to use session_id for OCW-Studio RC testing because I couldn't get past the SAML login thing.

I know that the testing instructions are still in progress, but I thought these stuff might be helpful to consider

Copy link
Contributor

@annagav annagav left a comment

Choose a reason for hiding this comment

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

I was able to follow the instruction in the RST file and set it up successfully. 👍

@JenniWhitman JenniWhitman merged commit 9c8a402 into main Oct 11, 2023
@JenniWhitman JenniWhitman deleted the jw/wsgi-tuning branch October 11, 2023 15:47
This was referenced Oct 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants