Page MenuHomePhabricator

Limit homepage application status badge queries
Closed, ResolvedPublic


On the home page, we currently build status counts and display them on the application tiles in the left nav. For example, Maniphest shows a count of assigned tasks and Differential shows assigned reviews.

These queries don't use limits, so a user who legitimately has thousands of assigned tasks will end up loading them all.

We should:

  • Limit these queries to something like 100 results, and show "99+" if there are more than 99, so a user with a large number of legitimate assigned tasks isn't paying a huge cost to load a ton of them (showing a count like "3920" is unlikely to be useful, anyway).
  • In the Maniphest case, we could make the Maniphest query more efficient by issuing a raw query instead of a proper ManiphestTaskQuery, which does additional data fetching and policy checks. We don't technically need to policy check the results because the owner of a task can always see it. Not sure if this is really worth it. If we want to press the performance issue here we should really add caches or consider removing the feature (I'm not sure how useful it is).

Support Impact This is a scalability issue which impacts large Maniphest installs, including WMF.

Event Timeline

epriestley raised the priority of this task from to Normal.
epriestley updated the task description. (Show Details)

D10876 was a specific bad case of this because of a bug (loading 73K "assigned tasks" for logged out users) but users with "only" a few thousand tasks (which is reasonable on real installs with real users) will currently pay a needlessly high performance penalty, and it should be possible to assign a user 75K tasks without making Phabricator unusable for them.