Bug 29032 - ILL route unusable (slow)
Summary: ILL route unusable (slow)
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: REST API (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low major (vote)
Assignee: Tomás Cohen Arazi
QA Contact: Martin Renvoize
URL:
Keywords:
Depends on:
Blocks: 22440
  Show dependency treegraph
 
Reported: 2021-09-15 15:02 UTC by Tomás Cohen Arazi
Modified: 2023-06-08 22:26 UTC (History)
8 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
21.11.00,21.05.05,20.11.11,20.05.17,19.11.23


Attachments
Bug 29032: Pre-load ILL backends to speed up response (2.83 KB, patch)
2021-09-15 15:16 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 29032: Pre-load ILL backends to speed up response (2.89 KB, patch)
2021-09-15 17:49 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug 29032: Pre-load ILL backends to speed up response (2.47 KB, patch)
2021-09-15 18:10 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 29032: Pre-load ILL backends to speed up response (2.54 KB, patch)
2021-09-21 13:36 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Tomás Cohen Arazi 2021-09-15 15:02:40 UTC
With only 20 ill requests, for the same backend, the page takes lots of seconds to load.

Steps to reproduce:
1. Add 23 requests with your favourite ILL backend
2. Hit the ILL requests page
=> FAIL: Notice it takes ages to load
Comment 1 Tomás Cohen Arazi 2021-09-15 15:16:34 UTC
Marking it RM_priority so it can be backported ASAP to stable branches once we are sure it works correctly.
Comment 2 Tomás Cohen Arazi 2021-09-15 15:16:56 UTC
Created attachment 124899 [details] [review]
Bug 29032: Pre-load ILL backends to speed up response

Bug 22440 will rewrite the route and make it even more efficient by
prefetching the related data instead of performing several queries in
loops.

In the meantime, we can make this controller perform better with a
simple intervention: load backends once, and use the
$request->_backend() setter to pre-set it before using the objects.

To test:
1. Perform any usual ILL requests listing, try having several
=> FAIL: Notice it takes a weird amount of time to load
2. Apply this patch
3. Restart all
4. Repeat 1
=> SUCCESS: It feels fast enough!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 3 Andrew Fuerste-Henry 2021-09-15 17:49:26 UTC
Created attachment 124904 [details] [review]
Bug 29032: Pre-load ILL backends to speed up response

Bug 22440 will rewrite the route and make it even more efficient by
prefetching the related data instead of performing several queries in
loops.

In the meantime, we can make this controller perform better with a
simple intervention: load backends once, and use the
$request->_backend() setter to pre-set it before using the objects.

To test:
1. Perform any usual ILL requests listing, try having several
=> FAIL: Notice it takes a weird amount of time to load
2. Apply this patch
3. Restart all
4. Repeat 1
=> SUCCESS: It feels fast enough!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 4 Tomás Cohen Arazi 2021-09-15 18:10:34 UTC
Created attachment 124906 [details] [review]
Bug 29032: Pre-load ILL backends to speed up response

Bug 22440 will rewrite the route and make it even more efficient by
prefetching the related data instead of performing several queries in
loops.

In the meantime, we can make this controller perform better with a
simple intervention: load backends once, and use the
$request->_backend() setter to pre-set it before using the objects.

To test:
1. Perform any usual ILL requests listing, try having several
=> FAIL: Notice it takes a weird amount of time to load
2. Apply this patch
3. Restart all
4. Repeat 1
=> SUCCESS: It feels fast enough!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 5 Martin Renvoize 2021-09-21 13:36:28 UTC
Created attachment 125107 [details] [review]
Bug 29032: Pre-load ILL backends to speed up response

Bug 22440 will rewrite the route and make it even more efficient by
prefetching the related data instead of performing several queries in
loops.

In the meantime, we can make this controller perform better with a
simple intervention: load backends once, and use the
$request->_backend() setter to pre-set it before using the objects.

To test:
1. Perform any usual ILL requests listing, try having several
=> FAIL: Notice it takes a weird amount of time to load
2. Apply this patch
3. Restart all
4. Repeat 1
=> SUCCESS: It feels fast enough!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 6 Martin Renvoize 2021-09-21 13:36:57 UTC
Nice speed up here.. No regressions found

PQA
Comment 7 Jonathan Druart 2021-09-21 18:19:16 UTC
Pushed to master for 21.11, thanks to everybody involved!
Comment 8 Kyle M Hall 2021-10-01 18:26:37 UTC
Pushed to 21.05.x for 21.05.05
Comment 9 Fridolin Somers 2021-10-09 02:15:17 UTC
Pushed to 20.11.x for 20.11.11
Comment 10 Victor Grousset/tuxayo 2021-10-17 01:13:43 UTC
Backported: Pushed to 20.05.x branch for 20.05.17
Comment 11 wainuiwitikapark 2021-10-18 02:43:12 UTC
Backported to 19.11.x for 19.11.23