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

Tune uWSGI settings based on application profile #1682

Open
rhysyngsun opened this issue Jun 20, 2023 · 7 comments
Open

Tune uWSGI settings based on application profile #1682

rhysyngsun opened this issue Jun 20, 2023 · 7 comments

Comments

@rhysyngsun
Copy link
Collaborator

rhysyngsun commented Jun 20, 2023

See my writeup on how to approach this: https://github.com/mitodl/hq/discussions/393

The current settings on xPro (workers = 3, threads = 25) is probably a good starting point for values.

@JenniWhitman
Copy link
Contributor

JenniWhitman commented Oct 6, 2023

I think the optimal approach is to follow what work Ibrahim did in xPro to match Nathan's writeup - no point in reinventing the wheel and it looks like the approach was fairly simple. This involves:

  1. Adding uwisgitop to the requirements
  2. Adding locust to the requirements
  3. identifying endpoints that will simulate a user's load
  • This will likely look like loading:
    • home page
    • catalog
    • catalog with a couple of filters to simulate browsing
    • course page(s)
    • program page(s)
    • Login (this might be complex and has not changed, will confer with James or someone if I can't "Django" through this - will try to just grab and auth a django user in the locustfile and if that doesn't work, will bail)
    • dashboard load
    • IDEALLY we would also look at running some of the requests to and from edx, but this requires that running as expected. Will try locally and see how it behaves - again, won't waste a ton of time, to start I'm most interested in the home page loading of JUST the mitxonline application
  1. Creating the locustfile.py for this - Ibrahim did not add an example file to xpro that I saw, but I plan to both to aid in quicker testing and as a breadcrumb for future tests
  2. Run the test locally
  3. Identify the best settings locally based on data
  4. push to RC
  5. Run in RC
  6. identify settings there based on data
  7. change settings

I plan to create one PR to add the requirements, example locustfile, and run the test locally. I'll add findings to this issue. Will then do the same in RC, adding findings to this issue, then will Have a separate, second PR which changes the settings for good + closes this issue, once we're satisfied with the result.

@pdpinch
Copy link
Member

pdpinch commented Oct 6, 2023

Creating the locustfile.py for this - Ibrahim did not add an example file to xpro that I saw, but I plan to both to aid in quicker testing and as a breadcrumb for future tests

@ibrahimjaved12 was working on ocw-studio. If he hasn't shared the file in that repo, he should.

Otherwise, this looks like the right plan. Let's get started!

@JenniWhitman
Copy link
Contributor

I meant OCW 🤦 The locust file is in a comment on the PR, so I have his structure (thankfully! Hence why I expect this to be wrapped up so quickly), but i think the better breadcrumb moving forward would be to include things in a doc or example file. We have a docs folder on mitxonline, so I'm planning to make sure it's noted so we can "re-tune" quickly and easily in the future :)

@JenniWhitman
Copy link
Contributor

This work helped identify performance issues on /catalog of the redesign. That is being tracked here: https://github.com/mitodl/hq/issues/2781. The completion of this work is pending changes to the catalog page and completion of that ticket. At that point I will rerun tests and we'll work with what we have then.

@pdpinch
Copy link
Member

pdpinch commented Jan 24, 2024

@JenniWhitman are you actively working on this? If not, we should move it back to in triage.

@JenniWhitman
Copy link
Contributor

@pdpinch
No, I'm not actively working on it right now, I was waiting on completion of the catalog work, however, seeing as we're not making any more major API changes we COULD go back and rerun this/do some tuning.

@JenniWhitman
Copy link
Contributor

(so, ready column over triage potentially)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants