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

Deck detail page is slow and uncached #4926

Open
vorpal-buildbot opened this issue Jun 8, 2018 · 7 comments
Open

Deck detail page is slow and uncached #4926

vorpal-buildbot opened this issue Jun 8, 2018 · 7 comments
Labels
- backlog Non-urgent tasks deferred until someone wants to work on them * decks pennydreadfulmagic.com (but use more specific label if available) + perf

Comments

@vorpal-buildbot
Copy link
Contributor

Reported on Discord by bakert#2193

@triage-new-issues triage-new-issues bot added the triage Used by bot to label unlabeled tasks, will be removed automatically upon labeling label Jun 8, 2018
@bakert
Copy link
Member

bakert commented Jun 8, 2018

Over 50 page loads taking more than a minute in the last three hours.

@bakert bakert added * decks pennydreadfulmagic.com (but use more specific label if available) + perf labels Jun 8, 2018
@triage-new-issues triage-new-issues bot removed the triage Used by bot to label unlabeled tasks, will be removed automatically upon labeling label Jun 8, 2018
@bakert
Copy link
Member

bakert commented Jun 11, 2018

In terms of reported slow pages this page is now dominating all others at something like 100:1 ratio.

In an attempt to speed up the site in general I tried to slow down bots with f48e8dd. But making this page faster will surely have a good effect.

@silasary
Copy link
Member

If you disable redis (config.json,: redis_enabled), does this get better or worse?

@silasary
Copy link
Member

At a guess, it'll get worse.

Looking at the decks that are being reported, they tend to fall into two categories.

  • Decks that are active and/or have just finished a run, hit by humans.
  • Decks that are absolutely ancient, hit by robots.

Tournament/imported decks are not appearing anywhere near as frequently.

This tends to imply that the redis cache is working well, for the decks that are actually loaded into cache, and the slow pages are tending towards decks that aren't in redis.

@bakert
Copy link
Member

bakert commented Aug 30, 2018

Deck detail page is no longer dominating slow pages as it was in June. Various perf improvements have changed a lot of the variables since then.

/, /seasons/all/, /seasons/all/* and deck detail pages make up a lot of it, though.

It occurs to me that we treat deck detail page as uncacheable because we show different views to admin/owner than we do to others when the deck is in a run BUT (a) the vast majority decks are not in a run, and (b) that's only two different views of the page not one-per-user or anything like that.

Can we complicate our caching code to cache two versions of a page based on a switch and determine the value of that switch at cache-decision-time?

@bakert bakert changed the title Deck detail page is slow (related to redis issue?) Deck detail page is slow and uncached Aug 30, 2018
@bakert
Copy link
Member

bakert commented Sep 5, 2018

It's definitely easy to add can_view as part of the cache key based on is_admin but is_owner seems tougher as there's not a very sensible way to access that kind of info from cache.py nor pass it in. Needs a bit of thought.

@bakert bakert added the - backlog Non-urgent tasks deferred until someone wants to work on them label Sep 11, 2018
@bakert
Copy link
Member

bakert commented Sep 11, 2018

While it would be great to cache based on a key of (url, locale, is_admin_or_owner) it's non-trivial and not the most pressing perf concern right now so backlogging. We should do this at some point though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- backlog Non-urgent tasks deferred until someone wants to work on them * decks pennydreadfulmagic.com (but use more specific label if available) + perf
Projects
None yet
Development

No branches or pull requests

3 participants