GET circulation/loans Report (Fameflower and Goldrenrod)


PERF-73 - Getting issue details... STATUS


Overview

GET circulation/loans response time is nearly 300ms (75th percentile) - in fact more than 400 with 8 users. Investigate this API call to understand why it is slow.

API call  - [/circulation/loans?query=%28userId=${UserID}+and+status.name%3C%3EClosed%29&limit=1];

Summary

  • GET /circulation/loans averages 400ms for 8 users
  • Performance degrades over time as memory leaks on mod-feesfines accumulates.
  • MODFEE-93 - Getting issue details... STATUS  is created to address memory leaks.
  • Calls to mod-feesfines account for about half of the response time.

Test Runs


test#VUsersDuration (min)OKAPI log levelAPI call
4860info/circulation/loans?query=%28userId=${UserID}+and+status.name%3C%3EClosed%29&limit=1];

3

8

60

Info/circulation/loans?query=%28userId=${UserID}+and+status.name%3C%3EClosed%29&limit=1];
2860warning/circulation/loans?query=%28userId=${UserID}+and+status.name%3C%3EClosed%29&limit=1];
1860warning/circulation/loans?query=%28userId=${UserID}+and+status.name%3C%3EClosed%29&limit=1];
0860warning/circulation/loans?query=%28userId=${UserID}+and+status.name%3C%3EClosed%29&limit=1];


Test results


test 4Link on grafana test
RequestsTotalOKKO% KOReq/sMin50th pct75th pct95th pct99th pctMaxAverageLatency



GET_circulation/loans60036003001.6630.2564.1745.928.56311.23713.1814.7568.563
test 3Link on grafana test
RequestsTotalOKKO% KOReq/sMin50th pct75th pct95th pct99th pctMaxAverageLatency

GET_circulation/loans89988998002.4960.2633.053.9915.8946.9779.3263.1725.894
test 2Link on grafana test
RequestsTotalOKKO% KOReq/sMin50th pct75th pct95th pct99th pctMaxAverageLatency

GET_circulation/loans1185311853003.2890.2432.0693.154.2395.97.1662.4074.239
test 1Link on grafana test
RequestsTotalOKKO% KOReq/sMin50th pct75th pct95th pct99th pctMaxAverageLatency

GET_circulation/loans40663406630011.2910.240.4011.091.3522.1434.4450.7011.352
test 0Link on grafana test
RequestsTotalOKKO% KOReq/sMin50th pct75th pct95th pct99th pctMaxAverageLatency

GET_circulation/loans592095813210771.81916.4420.1410.3920.5310.9161.0682.5610.4810.916

As you can see there's degradation of response times (test order from 0 to 4) especially it can be seen on 75 percentiles value. 

The assumption is - mod- feesfines has a memory leak that causes the high CPU usage and leading to container restart after reaching memory limit.

Resource utilization (test4):

CPU Utilization

RAM Usage

Heap Dump:

As you can see 22%  of heap are taken by HTTPClient. The recommendation is to close HTTPClient explicitly to avoid unnecessary heap overflow.

In another test run: 

Giraffe Diagram

From chart above, you can see that there's a lot of mod-feesfines calls happened internally. They take between 100 and 300 milliseconds, for now this is more time expensive process founded.

DataBase CPU utilization was always in normal. not higher than 5 %.

No slow queries and missed indexes was found.