Page MenuHomePhabricator

Long loading times for campaign landing page
Open, Needs TriagePublic


Loading campaign 228 takes a lot longer than e.g. campaign 82. Campaign 228 takes as long again if I reload the page as well.

So obviously it's processing the stats live each time the page gets requested and not caching the results at all. For a campaign with a lot of images/contributions this sometimes leads to a 520 error.

Two things to investigate:

  • Are more things being processed than is needed for what is being displayed on the page?
  • Can some of the things bee processed, and cached, in the back-end instead?

Event Timeline

Lokal_Profil added a subscriber: Anthere.

Ping @Anthere Does this capture what you encountered?

Yup, I guess it does. Thanks !

I looked into this a bit and as far as I can tell, database queries takes the most time here. I ran locally with the campaign 228 and out of a total of 75 seconds:

  • Getting contributions from database: 16 s
  • Running isa.campaigns.utils.get_table_stats(): 56 s

I didn't look into get_table_stats() in details, but it has a couple of database queries, possibly more in function calls. I don't know enough about databases to say if this is to be expected or if there is a simple solution for it.

If it's too much work so sort this out (at the moment) it might be a good idea to not show the contributions on the campaign overview page. Instead the stats can be calculated and shown on the stats page. There should probably be a notice that it may take a while.