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

Investigate slow performance of page requests with lots of items #1676

Open
cbeer opened this issue Aug 6, 2023 · 2 comments · May be fixed by #1733
Open

Investigate slow performance of page requests with lots of items #1676

cbeer opened this issue Aug 6, 2023 · 2 comments · May be fixed by #1733
Assignees

Comments

@cbeer
Copy link
Member

cbeer commented Aug 6, 2023

E.g.:
https://requests-folio-dev.stanford.edu/requests/new?item_id=L284&origin=LANE-MED&origin_location=LANE-SAL3
https://requests-folio-dev.stanford.edu/requests/new?item_id=L13&origin=LANE-MED&origin_location=LANE-COR
https://requests-folio-dev.stanford.edu/requests/new?item_id=L17&origin=LANE-MED&origin_location=LANE-COR
https://requests-folio-dev.stanford.edu/requests/new?item_id=3248266&origin=SAL3&origin_location=PAGE-MP

Hopefully the -prod environment will speed up these requests, but we should do some due diligence and:

  • see where the performance bottlenecks are,
  • see if there are "easy" fixes we can make immediately, and
  • create tickets for larger application re-work (e.g. async loading of holdings information)
@cbeer cbeer converted this from a draft issue Aug 6, 2023
@jcoyne jcoyne moved this from 🔖 Ready to 🏗 In progress in Searchworks/FOLIO Summer 2022/23 Aug 8, 2023
@jcoyne jcoyne self-assigned this Aug 8, 2023
@jcoyne
Copy link
Contributor

jcoyne commented Aug 8, 2023

For L284:

I, [2023-08-08T10:54:12.397376 #3495995]  INFO -- : [49276810-9203-4f07-b2d5-db3d745a2679] Processing by PagesController#new as HTML
I, [2023-08-08T10:54:12.397484 #3495995]  INFO -- : [49276810-9203-4f07-b2d5-db3d745a2679]   Parameters: {"item_id"=>"L284", "origin"=>"LANE-MED", "origin_location"=>"LANE-SAL3"}
...
I, [2023-08-08T10:54:46.030230 #3495995]  INFO -- : [49276810-9203-4f07-b2d5-db3d745a2679] Completed 200 OK in 33633ms (Views: 8909.2ms | ActiveRecord: 0.6ms | Allocations: 13773000)

The step that takes all the time is Request#pageable?

new_params = {"item_id"=>"L284", "origin"=>"LANE-MED", "origin_location"=>"LANE-SAL3"}
current_request = Request.new(new_params)
current_request.pageable?

The underlying cause of this is because the GraphQL client takes a long time (~33s) to return results:

 require 'benchmark'
puts Benchmark.measure { FolioGraphqlClient.new.instance(hrid: 'L284') }
  0.035882   0.008006   0.043888 ( 32.931976)
 => nil

@jcoyne jcoyne removed their assignment Aug 9, 2023
@jcoyne jcoyne moved this from 🏗 In progress to 🔖 Ready in Searchworks/FOLIO Summer 2022/23 Aug 9, 2023
@corylown
Copy link
Contributor

corylown commented Aug 9, 2023

  • One fallback would be load the page right away, but show a loading widget.
  • We should look to see if there are optimizations to be made in graphql.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 📋 Backlog
Development

Successfully merging a pull request may close this issue.

4 participants