verify and reduce the cost of expanding permissions

Description

please provide loglines for the slow reqeuests

The interesting call 3 lines from the bottom.. 0.341 seconds

Environment

None

Potential Workaround

None

Attachments

4

Checklist

hide

TestRail: Results

Activity

Show:

Hongwei Ji October 2, 2019 at 1:58 PM

BTW, I did my test using the old mod-authtoken, and also tried hitting mod-perms API directly. You can try that and see the difference.

Adam Dickmeiss October 2, 2019 at 12:53 PM
Edited

I ran the check-out / check-in process in MODAT-51.. I did not see any noticable difference between master of mod-permissions and . This is because the caching is done in mod-authtoken anyway and that kicks in first.

Attached are check-in/check-out for folio-testing using patch.. The i-set is the initial check-in/check-out which are a lower slower then subsequent requests.

The set for master version of mod-permissions (without ) are attached in MODAT-51

Hongwei Ji September 27, 2019 at 9:59 AM

The existing cache we put in was to improve this API. It returns an array of string. https://s3.amazonaws.com/foliodocs/api/mod-permissions/permissions.html#perms_users__id__permissions_get

The above logged line uses this API and it expands module perm set to a full blown permission object with all the extra fields. https://s3.amazonaws.com/foliodocs/api/mod-permissions/permissions.html#perms_permissions__id__get

I do not have the exact metrics for what you are asking. I was simply trying to change the existing cache (select jsonb->>'permissionName', jsonb->>'subPermissions') to (select all). The db query is fast (under ms), but retrieve all the data (1160 rows) from db and convert to full Permission object takes time. From OKAPI log, it is over 1 second. If we refresh cache as frequent as before (30 seconds), it is not sustainable.

Jakub Skoczen September 27, 2019 at 9:45 AM

can you clarify the statement above, I am not sure I understand.

Also, can you provide metrics for:

  • loading permission into the cached (DB query time), e.g for BugFest-size permission table

  • expanding permissions (CPU time)

Hongwei Ji September 24, 2019 at 2:35 PM

By inspecting the API response it looks like the full permission objects are returned. Current cache based expansion only helps perm to subperm names.

Done

Details

Assignee

Reporter

Priority

Story Points

Sprint

Development Team

Core: Platform

Fix versions

TestRail: Cases

Open TestRail: Cases

TestRail: Runs

Open TestRail: Runs

Created September 24, 2019 at 1:57 PM
Updated October 15, 2019 at 10:03 AM
Resolved October 7, 2019 at 4:03 PM
TestRail: Cases
TestRail: Runs