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

Optimisation of UOP API queries (not used) #1195

Open
16 of 21 tasks
ACLay opened this issue Oct 17, 2024 · 0 comments
Open
16 of 21 tasks

Optimisation of UOP API queries (not used) #1195

ACLay opened this issue Oct 17, 2024 · 0 comments
Assignees
Labels
area: uop/stfc An issue relating to the STFC user office project. type:epic

Comments

@ACLay
Copy link

ACLay commented Oct 17, 2024

This issue has been replaced by one in ISISBusApps. See https://github.com/isisbusapps/ISISBusApps/issues/1023.

What is the problem and why is it a problem

During yesterday's ISIS direct call the UOP's responsiveness fell to a crawl under the load. To improve performance, one area we've identified that should easily give performance gains is reducing the quantity of data we fetch from the API.

This falls into two main categories:

Reducing the number of API calls made

Pages seem to load data that they don't need, or have already requested. For instance, when I connect to the main landing page as a user, the following graphql requests are made:

  • getSettings
  • getFeatures
  • getUserProposals
  • getPageContent - HOMEPAGE
  • getCalls
  • getPageContent - PRIVACYPAGE
  • getPageContent - HELPPAGE
  • getPageContent - FOOTERCONTENT
  • getCalls

While some of these are understandable and necessary to render the page, others are not. The home page shouldn't need to load the contents of the privacy and help pages. The main dynamic content of a user's homepage is a list of their proposals, so there shouldn't be any need to make multiple requests to getCalls, and one of those is only ever used to pre-populate the "New Proposal"/"Select a call" page, which a user may not even want to visit.

Reducing the quantity of data requested in each API call

To take from the above example, one of those getCalls requests is used to pre-populate the "Select a call" page where a user would go to create a new proposal. The fields used in that page are: id, shortCode, endCall, endCallInternal, title, templateId, description, cycleComment, but the getCalls request includes every single access panel, instrument, and instrument scientist attached to every open call. Especially when that getCalls request is combined with our slow external users service, that's a lot of unnecessary load when multiplied across every page load and user.

For that case it seems like the queries used in the frontend have just been added to and added to so that they can be re-used everywhere that needs a particular type of data, rather than adding new small and specific queries that graphql enables us to make.

Areas identified to improve

Interesting tech that may help

@ACLay ACLay added area: uop/stfc An issue relating to the STFC user office project. type:epic labels Oct 17, 2024
@joshhdawes joshhdawes changed the title UOP seems to be massively overfetching data from the backend Optimisation of UOP API queries Oct 30, 2024
@joshhdawes joshhdawes changed the title Optimisation of UOP API queries Optimisation of UOP API queries (not used - see #1023) Nov 27, 2024
@joshhdawes joshhdawes changed the title Optimisation of UOP API queries (not used - see #1023) Optimisation of UOP API queries (not used) Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: uop/stfc An issue relating to the STFC user office project. type:epic
Projects
None yet
Development

No branches or pull requests

4 participants