Done
Details
Assignee
Hongwei JiHongwei JiReporter
Hongwei JiHongwei JiLabels
Priority
P2Story Points
5Sprint
NoneDevelopment Team
Core: PlatformFix versions
TestRail: Cases
Open TestRail: CasesTestRail: Runs
Open TestRail: Runs
Details
Details
Assignee
Hongwei Ji
Hongwei JiReporter
Hongwei Ji
Hongwei JiLabels
Priority
Story Points
5
Sprint
None
Development Team
Core: Platform
Fix versions
TestRail: Cases
Open TestRail: Cases
TestRail: Runs
Open TestRail: Runs
Created May 31, 2019 at 2:40 PM
Updated June 12, 2019 at 2:01 PM
Resolved June 12, 2019 at 8:40 AM
In BugFest 2.1 performance analysis, we see 2755 mod-permissions entries out of 5817 total slow entries (see FOLIO-2039). Some of those entries are very slow (about 10s). There are only two simple small tables in mod-permissions module, so there is no reason to be so slow. Also given the frequency of mod-authtoken queries mod-permissions, this impacts the whole FOLIO system in a broad scale. We have to improve its performance. Given the relative static nature of permissions we probably should consider to use cache. Also checking for missing indexes and potentially duplicated calls. BTW, here is a sample query that takes about 2 seconds in an idle system. Ideally this should be improved to be at milliseconds level, so permission check does not impact system performance.
Implementation notes
1. Verify why the function is so slow and if there is a way to speed it up (e.g by introducing a DB index on the userId field).
1a. query by id should not use Criteria but optimized PostgresClient.getById or PgUtil.getById
1b. We suspect that the function may be issuing recursive DB queries – if that's the case try to optimize with a JOIN if not possible or viable use caching.
2. Cut down the total number of DB calls by introducing in-memory caching.
3. Add a jmeter test for looking up user permissions by userId to the platform-perf-test