/
PTF - Performance testing of CPU=0 for Services (QCP1)

PTF - Performance testing of CPU=0 for Services (QCP1)

Overview

  • In this report, PTF tries to reproduce a bug where one of the modules fails with 500 response code possibly due to resource starvation. The theory was that a few high-usage modules were possibly placed on the same instance with the CPU=0 parameter, leading to resource contention and failure in one of the modules.  Setting CPU=0 doesn't set any limit or declare any required CPU resources at services' startup, so theoretically a service may use up as much CPU as it needs. But also theoretically ECS should do a fair job of limiting the CPU usage of a running service if other services are running at the same time.  The experiments performed in this ticket are designed to see if ECS does it job, that is, fairly regulate CPU utilization of all modules and if not, would it lead to resource starvation and 500 errors. 

PERF-1010 - Retest DI + CICO with CPU =0 Closed  

Summary

  • In Test №4, the following services were grouped per instance:
    • Instance 1: mod-circulation, mod-source-record-storage (2 tasks), okapi tasks
    • Instance 2: mod-circulation-storage (2 tasks), mod-circulation tasks
    • Instance 3: mod-source-record-manager, nginx-okapi, mod-inventory-storage, okapi, mod-inventory, mod-authorization tasks
    • Instance 4: mod-authorization, okapi, mod-inventory, mod-source-record-manager, pub-okapi, nginx-okapi, mod-inventory-storage tasks
  • During the tests, we observed that when Data Import began without CICO (Check-In Check-Out), some modules, such as mod-inventory, consumed a significant amount of CPU. However, when CICO started concurrently, mod-inventory's CPU usage decreased. Once CICO was completed, mod-inventory resumed its higher CPU usage.  This means that ECS regulates the CPU utilizations of the services and does not allow any one service to use up all CPU resources in the ec2 instance.  In all tests, there were no 500 errors observed, so the cause of the HTTP 500 bug is not due to CPU starvation, and definitely not because of setting CPU = 0. 

Test Runs

Test #DescriptionStatus
Test 1The QCP1 Environment configuration was applied. Check In\Check Out with 30 users for one tenant on 30 minutes and Data Import - Create with 50k records files tests were run.Completed
Test 2The QCP1 Environment configuration was applied. Check In\Check Out with 30 users for one tenant on 30 minutes and Data Import - Create with 50k records files tests were run.Completed
Test 3The QCP1 Environment configuration was applied. Check In\Check Out with 30 users for one tenant on 30 minutes and Data Import - Create with 50k records files tests were run.Completed
Test 4The QCP1 Environment configuration was applied. Check In\Check Out with 30 users for one tenant on 30 minutes and Data Import - Create with 50k records files tests were run.Completed

Test Results

This table contains response time for Check In\Check Out and durations for Data Import tests

RequestsTest №1Test №2Test №3Test №4

Error %Average95th pctError %Average95th pctError %Average95th pctError %Average95th pct
Check-In Controller1.01%186823880.87%193623080%161420440%25243413

Check-Out Controller

1.46%325043201.24%334739780.03%281935510.06%45486088

Data Import
(PTF - Create 2)

0%Duration1 record
failed
Duration0%Duration0%Duration
0:50:250:49:540:46:040:45:46



Test №1

The Baseline QCP1 Environment configuration was applied, and CPU=0 was set for all modules, ECS infrastructure was configured according to requested steps.

Results: Results had errors for authorization service.

Service CPU Utilization

Here we can see that mod-inventory module used 36% Instances CPU power before CICO started, than mod-inventory module used 27% Instances CPU power during CICO and 24% Instances CPU power after CICO.

Service Memory Utilization

Here we can see that mod-permissions used 80% memory.


Kafka metrics


DB CPU Utilization

DB CPU was 99% average with ERW: Exporting Receiving Information

DB Connections

Max number of DB connections was 900.

DB load

                                                                                                                    

Top SQL-queries

Test №2

The Baseline QCP1 Environment configuration was applied, and CPU=0 was set for all modules, ECS infrastructure was configured according to requested steps.

Results: Results had errors for authorization service, problem was in Rump up periods.

Service CPU Utilization

Here we can see that mod-inventory module used 35% Instances CPU power before CICO started, than mod-inventory module used 24% Instances CPU power during CICO and 27% Instances CPU power after CICO.

Service Memory Utilization

Here we can't see any sign of memory leaks on every module. Memory shows stable trend.


Kafka metrics



DB CPU Utilization

DB CPU was 89%

DB Connections

Max number of DB connections was 975.

DB load

                                                                                                                     

Top SQL-queries


Test №3

The Baseline QCP1 Environment configuration was applied, and CPU=0 was set for all modules, ECS infrastructure was configured according to requested steps, Rump up set 120 for avoid errors with authorization.

Results: Result did not have errors for authorization service, only one error with data preparation "Item is already checked out".

Service CPU Utilization

Here we can see that mod-inventory module used 34% Instances CPU power before CICO started, than mod-inventory module used 26% Instances CPU power during CICO and 25% Instances CPU power after CICO.

Service Memory Utilization

Here we can't see any sign of memory leaks on every module. Memory shows stable trend.


Kafka metrics



DB CPU Utilization

DB CPU was 90% maximum.

DB Connections

Max number of DB connections was 2112.

DB load

                                                                                                                   

Top SQL-queries

Test №4

The Baseline QCP1 Environment configuration was applied, and CPU=0 was set for all modules, ECS infrastructure was configured according to requested steps, Rump up set 120 for avoid errors with authorization.

Results: Result did not have errors for authorization service, only two errors with data preparation "Item is already checked out".

Instance CPU Utilization


Tasks placement


Service CPU Utilization

Here we can see that mod-inventory module used 36% Instances CPU power before CICO started, than mod-inventory module used 26% Instances CPU power during CICO and 44% Instances CPU power after CICO.

Service Memory Utilization

Here we can't see any sign of memory leaks on every module. Memory shows stable trend.

Kafka metrics



DB CPU Utilization

DB CPU was 81%.

DB Connections

Max number of DB connections was 925.

DB load

                                                                                                                    

Top SQL-queries



Appendix

Infrastructure

PTF - Baseline QCP1 environment configuration (was changed during testing)

  • 10 m6g.2xlarge EC2 instances located in US East (N. Virginia)us-east-1
  • 1 database  instance, writer

    NameMemory GIBvCPUs

    db.r6g.xlarge

    32 GB4 vCPUs
  • Open Search ptf-test 
    • Data nodes
      • Instance type - r6g.2xlarge.search
      • Number of nodes - 4
      • Version: OpenSearch_2_7_R20240502
    • Dedicated master nodes
      • Instance type - r6g.large.search
      • Number of nodes - 3
  • MSK fse-tenant
    • brokers, kafka.m7g.xlarge brokers in 2 zones
    • Apache Kafka version 3.7.x 

    • EBS storage volume per broker 300 GiB

    • auto.create.topics.enable=true
    • log.retention.minutes=480
    • default.replication.factor=3


 qcp1 modules memory and CPU parameters

Cluster Resources - qcp1-pvt

Wed Oct 09 08:32:57 UTC 2024
ModuleTask Definition RevisionModule VersionTask CountMem Hard LimitMem Soft LimitCPU UnitsXmxMetaspace SizeMax Metaspace Size
mod-remote-storage9mod-remote-storage:3.2.024920447210243960512512
mod-ncip9mod-ncip:1.14.421024896076888128
mod-finance-storage9mod-finance-storage:8.6.021024896102470088128
mod-sudoc3mod-sudoc:1.021024896076888128
mod-agreements9mod-agreements:7.0.02159214880000
mod-ebsconet9mod-ebsconet:2.2.0212481024128700128256
mod-organizations9mod-organizations:1.9.021024896076888128
mod-consortia7mod-consortia:1.1.025136477610244416384512
edge-sip27edge-sip2:3.2.0-SNAPSHOT.20921024896076888128
mod-serials-management9mod-serials-management:1.0.022480231201792384512
mod-settings9mod-settings:1.0.32102489620076888128
mod-data-import12mod-data-import:3.1.01204818442561292384512
edge-dematic9edge-dematic:2.2.011024896076888128
mod-search9mod-search:3.2.0225922480204814405121024
mod-inn-reach7mod-inn-reach:3.2.0-SNAPSHOT.86236003240102428805121024
mod-tags9mod-tags:2.2.021024896076888128
edge-courses9edge-courses:1.4.021024896076888128
mod-authtoken13mod-authtoken:2.15.121440115251292288128
mod-inventory-update9mod-inventory-update:3.3.021024896076888128
mod-notify9mod-notify:3.2.021024896076888128
mod-configuration9mod-configuration:5.10.021024896076888128
mod-orders-storage9mod-orders-storage:13.7.02102489651270088128
edge-caiasoft9edge-caiasoft:2.2.021024896076888128
mod-login-saml9mod-login-saml:2.8.021024896076888128
mod-erm-usage-harvester9mod-erm-usage-harvester:4.5.021024896076888128
mod-licenses9mod-licenses:6.0.02248023125121792384512
mod-gobi9mod-gobi:2.8.021024896076888128
mod-password-validator9mod-password-validator:3.2.02144012980768384512
mod-bulk-operations9mod-bulk-operations:2.0.023072260001536384512
mod-fqm-manager9mod-fqm-manager:2.0.121024896076888128
edge-dcb9edge-dcb:1.1.021024896076888128
mod-graphql10mod-graphql:1.12.121024896076888128
mod-finance9mod-finance:4.9.021024896076888128
mod-erm-usage9mod-erm-usage:4.7.022800255010241800384512
mod-batch-print10mod-batch-print:1.1.021024896076888128
mod-copycat9mod-copycat:1.6.021024896076888128
mod-lists9mod-lists:2.0.021024896076888128
mod-entities-links10mod-entities-links:3.0.0225922480400144001024
mod-permissions16mod-permissions:6.5.02168415445121024384512
pub-edge5pub-edge:2023.06.1421024896276800
mod-orders9mod-orders:12.8.022048174010241024384512
edge-patron10edge-patron:5.1.02102489625676888128
edge-ncip9edge-ncip:1.9.221024896076888128
mod-marc-migrations7mod-marc-migrations:1.0.0-SNAPSHOT.521024896076888128
edge-inn-reach7edge-inn-reach:3.1.1-SNAPSHOT.4521024896076888128
mod-users-bl9mod-users-bl:7.7.021440115251292288128
mod-oa8mod-oa:2.1.0-SNAPSHOT.6221024896076888128
mod-inventory-storage12mod-inventory-storage:27.1.024096369020483076384512
mod-invoice11mod-invoice:5.8.121440115251292288128
mod-user-import9mod-user-import:3.8.021024896076888128
mod-sender10mod-sender:1.12.021024896076888128
edge-oai-pmh9edge-oai-pmh:2.9.021512136010241440384512
mod-data-export-worker9mod-data-export-worker:3.2.123072280010242048384512
mod-rtac10mod-rtac:3.6.021024896076888128
mod-circulation-storage10mod-circulation-storage:17.2.022880259215361814384512
mod-calendar9mod-calendar:3.1.021024896076888128
mod-source-record-storage21mod-source-record-storage:5.8.725600500020483500384512
mod-event-config9mod-event-config:2.7.021024896076888128
mod-courses9mod-courses:1.4.1021024896076888128
mod-circulation-item9mod-circulation-item:1.0.021024896076888128
mod-inventory11mod-inventory:20.2.022880259210241814384512
mod-email9mod-email:1.17.02280025505121800384512
mod-pubsub9mod-pubsub:2.13.02153614401024922384512
mod-circulation10mod-circulation:24.2.022880259215361814384512
mod-di-converter-storage9mod-di-converter-storage:2.2.021024896076888128
edge-rtac9edge-rtac:2.7.121024896076888128
edge-orders9edge-orders:3.0.021024896076888128
mod-users10mod-users:19.3.121024896076888128
mod-template-engine9mod-template-engine:1.20.021024896076888128
mod-patron-blocks9mod-patron-blocks:1.10.021024896102476888128
mod-audit9mod-audit:2.9.021024896076888128
edge-fqm9edge-fqm:2.0.021024896076888128
mod-source-record-manager10mod-source-record-manager:3.9.0-SNAPSHOT.33025600500020483500384512
nginx-edge5nginx-edge:2023.06.14210248962000
mod-quick-marc11mod-quick-marc:5.1.012288217601664384512
nginx-okapi5nginx-okapi:2023.06.14210248962000
okapi-b8okapi:5.3.03168414402922384512
mod-feesfines9mod-feesfines:19.1.021024896076888128
mod-invoice-storage9mod-invoice-storage:5.8.021872153610241024384512
mod-dcb10mod-dcb:1.1.021024896076888128
mod-service-interaction9mod-service-interaction:4.0.12204818442561290384512
mod-data-export22mod-data-export:5.0.412592248010241440881024
mod-patron10mod-patron:6.1.021024896076888128
mod-oai-pmh9mod-oai-pmh:3.13.024096369020483076384512
edge-connexion9edge-connexion:1.2.021024896076888128
mod-kb-ebsco-java9mod-kb-ebsco-java:4.0.021024896076888128
mod-notes9mod-notes:5.2.0210248960952384512
mod-data-export-spring9mod-data-export-spring:3.2.01204818442561536384512
mod-organizations-storage9mod-organizations-storage:4.7.021024896076888128
mod-login9mod-login:7.11.02144012981024768384512
pub-okapi5pub-okapi:2023.06.1421024896276800
mod-eusage-reports9mod-eusage-reports:2.1.121024896076888128


Methodology/Approach

CICO Tests: scenarios were started for 30 users by JMeter script from load generator and concurrently run manually DI 50k records from UI. 

Baseline QCP1 Environment configuration and steps to configure ECS infrastructure:

  • Having one ASG (auto scaling group) change instance type to be r7g.large to accelerate resource starvation for modules (baseline has r7g.2xlarge)

  • Manually unpause environment. (Not using FSE-Unpause folio job)

    • Unpause okapi, okapi-nginx, pub-okapi, mod-authtoken

    • Unpause mod-SRS, mod-SRM, mod-inventory, inventory-storage, mod-circulation, mod-circulation storage. Taking into account order of unpausing - it will place them all on instances that available now.

    • Unpause everything else by FSE-Unpause folio job (doesn’t matter placing here).

  • Test 1: The Baseline QCP1 Environment configuration was applied, and CPU=2 was set for all modules, ECS infrastructure was configured according to steps above. Check In\Check Out with 30 users for one tenant on 30 minutes and Data Import - Create with 50k records files tests were run.
  • Test 2: Repeat Test 1.
  • Test 3: Changed Rump-up period from 30 to 120 in JMeter script and run test for the same configuration like for Test 1.
  • Test 4: Restart environment and configure the same ECS infrastructure again like for Test 1 and run tests.


Related content