Defer slow fields on site configuration query

Description

The `sass_variables` and `page_elements` fields on `SiteConfiguration` are typically large JSON strings. Including them in the queries in `.get_value_for_org()` and `.get_all_orgs()` adds latency and load to the database and to the app server when Django decodes them. They aren't actually used in the context of those methods, so it is just extra work. On our deployment, this is typically 10-20ms per object/row returned. For most deployments, that is a minor issue. We run a multi-tenant deployment with many hundreds of organizations though and we see upwards of 10 seconds of latency added to certain views (LMS dashboard, CMS settings page).

We applied this patch to our production instance in July and saw the problem immediately disappear and we have not seen any bugs resulting from the patch.

I haven't really been able to figure out a good way to automatically test this change to prevent a regression since it's mainly a performance improvement. I'm open to ideas though.

Status

Assignee

Unassigned

Reporter

Open Source Pull Request Bot

Contributor Name

Anders Pearson

Repo

edx/edx-platform

Customer

None

Epic Link

None

OSCM Assignee

None

Platform Map Area (Levels 1 & 2)

None

Platform Map Area (Levels 3 & 4)

None

Priority

Unset
Configure