Skip to content

[$150] Investigate and fix performance #558

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

Closed
jmgasper opened this issue Apr 9, 2021 · 13 comments
Closed

[$150] Investigate and fix performance #558

jmgasper opened this issue Apr 9, 2021 · 13 comments

Comments

@jmgasper
Copy link
Collaborator

jmgasper commented Apr 9, 2021

@atelomycterus - We now have Tideways deployed and working in prod, thanks! Can you have a look and see if there are any quick fixes we can do to help with performance? I'm happy to adjust the payment up if we run into tricky issues, thanks.

@jmgasper
Copy link
Collaborator Author

jmgasper commented Apr 9, 2021

Challenge https://www.topcoder.com/challenges/9fffbcc9-590f-4890-abde-800c9ce3c826 has been created for this ticket.

This is an automated message for ghostar via Topcoder X

@jmgasper
Copy link
Collaborator Author

jmgasper commented Apr 9, 2021

Challenge https://www.topcoder.com/challenges/9fffbcc9-590f-4890-abde-800c9ce3c826 has been assigned to obog.

This is an automated message for ghostar via Topcoder X

@atelomycterus
Copy link
Collaborator

@jmgasper Yes, sure. Keep you updated.

@atelomycterus
Copy link
Collaborator

atelomycterus commented Apr 9, 2021

@jmgasper Please see attached Tideways Report. While waiting for your feedback, I am working on #475. Let me know which issues from the report should be fixed first. Thanks!

@jmgasper
Copy link
Collaborator Author

@atelomycterus - I think the easiest place to start would be to see if we can update the memcache without first invalidating the data set. That way there's always data in the memcache, even if it may be slightly out of date.

@atelomycterus
Copy link
Collaborator

atelomycterus commented Apr 10, 2021

@jmgasper Yes, sure. We can do the following:

  • Topcoder user data (Topcoder userId, handle, roles, pic url, rating). We can set 1 week or another value for it and update it from jwt token when user signs in. The Topcoder rating is only missing in jwt payload. The rating is recalculated after the end of the challenge, the expiration time can be set as the average duration of the challenge. Please correct me if I am wrong.
    Users who do not visit the Vanilla site, have not posted any content and are not members of groups will be removed from the cache automatically.
    Jwt payload:
    image

  • Role resources. Set default Memcached expiration time (3hours) or 1 day. I think that it is not updated often. Please correct me if I am wrong.

  • Challenge role resources. Topcoder handles with challenge roles are displayed for Challenge forums. When
    /group/XXX/unarchive => add Challenge role resources in cache, set expiration time to endDate or endDate +1 day,
    If it is requested again then set a default Memcached expiration time.

Let me know your feedback.

@jmgasper
Copy link
Collaborator Author

  1. Yes, this is fine. We can have the rating lag slightly without issue, I think, if it helps with performance.
  2. Yeah, roles shouldn't be updated often, and if this becomes a problem we can design something in the API to update specific users manually
  3. Yep, this sounds good.

@atelomycterus
Copy link
Collaborator

@jmgasper I am going to work on it tomorrow.

@atelomycterus
Copy link
Collaborator

@jmgasper Please apply PR-topcoder-platform/forums-plugins#88. Thanks! Sdgun will verify some tickets tomorrow. So I'll have a look and compare performance on DEV before and after changes. Keep you updated.

Please let me know which next tasks have higher priority.

@sdgun
Copy link
Collaborator

sdgun commented Apr 13, 2021

@atelomycterus Is there any impact of the performance fixes to any functionality? Just checking so I can focus on those before I do a sanity test. Thanks

@atelomycterus
Copy link
Collaborator

@sdgun From a functional point of view, no. This is more cache tuning, which data should be in the cache longer, etc. I'll verify it by analyzing requests with Tideways. So you can do a sanity test.

This morning there were a bunch of different suspicious requests. If you notice any strange behavior in Vanilla let me know. Thanks a lot!

@atelomycterus
Copy link
Collaborator

atelomycterus commented Apr 13, 2021

@jmgasper I've tested caching Topcoder data on DEV. It looks good. Let me know when the next production release is planned.
It would be nice to see the results when Vanilla has been working without deployment for several days.

Testing (DEV)

I flushed all memcached data. There were Topcoder API calls for the first several requests:
image

image

Group pages: Challenge roles were cached for challengeID. The second request didn’t load data from Topcoder API:
image

Discussion pages:
image

After 2 hours, no Topcoder API requests:
image

image

PROD

After deploying, I'll verify it:

@jmgasper
Copy link
Collaborator Author

Payment task has been updated: https://www.topcoder.com/challenges/9fffbcc9-590f-4890-abde-800c9ce3c826
Payments Complete
Winner: obog
Copilot: ghostar
Challenge 9fffbcc9-590f-4890-abde-800c9ce3c826 has been paid and closed.

This is an automated message for ghostar via Topcoder X

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