Capacity Testing with m7g KRaft mode MSK cluster

Capacity Testing with m7g KRaft mode MSK cluster

Overview

This document contains the results of testing workflows Check-out (Check-in had a functional issues at the moment) and Data Import for MARC Bibliographic records with PTF- Create-3 job profile in the Quesnelia release with MSK KRaft mode. Test were conducted on qcpt environment. The main idea is to see how number of topics and number of messages affects resource usage of MSK cluster and the main KPI for the testing flows. Tests should be performed with changed kafka broker number (2, 4, 6, 8) to achieve necessary load - 100.000 partitions in sync replicas.

Ticket: https://folio-org.atlassian.net/browse/PERF-939

Summary

  • Defining capacity for MSK instance type kafka.m7g.xlarge changing number of topics and messages

    • Changing the number of brokers for the same number of topics and synced messages we observe best performance with 6 brokers - stable data imports and check-out average response time 1.1 seconds which is not longer than in baseline test results with mcpt cluster.

    • Test with additional load using the script generating messages on topics which are not involved in data import and check-out do not affect performance of these flows.

    • Test with 6 brokers and 200.000 synced messages failed. Kafka was not stable with more than 90% of CPU.

    • Test with 8 brokers and 200.000 synced messages was successful. So the cluster can handle even this doubled load.

    • mod-pubsub-b module play important role during testing and affect CPU utilization of MSK brokers.

  • Resource utilization

    • 1'st test kafka.m7g.xlarge, 2 brokers, total topics: 6690, total partitions: 48062

      • Module CPU utilization: mod-pubsub-b - 82%, mod-inventory-b - 38%, mod-quick-marc-b - 35%, mod-dcb-b - 27%, okapi-b - 19%, mod-data-import-b - 17%

      • Module Memory: mod-inventory-b - 93%, mod-dcb-b - 88%, mod-permissions-b - 82%, mod-data-import-b - 63%, mod-quick-marc-b - 62%, mod-source-record-storage-b - 61%,  okapi-b- 60%, mod-search-b - 58%

    • 5'th test kafka.m7g.xlarge, 4 brokers, total topics: 6743, total partitions: online - 55872 In sync replicas - 111748

      • Module CPU utilization: mod-inventory-b - 56%, mod-quick-marc-b - 38%, mod-dcb-b - 26%, mod-pubsub-b - 23%, mod-di-converter-storage-b - 16%, okapi-b -16%, mod-configuration-b - 15%, mod-users-b - 13%, mod-search-b - 12%

      • Module Memory: 

    • 6'th test kafka.m7g.xlarge, 6 brokers, total topics: 6743, total partitions: online - 55872 In sync replicas - 111748

      • Module CPU utilization: spike of mod-data-import - 189%, mod-inventory - 86%, mod-quick-marc - 55%

      • Module Memory: mod-dcb-b - 104%, mod-inventory-b - 88%, mod-quick-marc-b - 62%, okapi-b - 60%, mod-search-b - 60%, mod-source-record-manager-b - 59%

Recommendations & Jiras

  • Module mod-pubsub-b was not stable and stopped containers due to out of memory. Allocating more resources could resolve the problem. The last configuration for this module:  "cpu": 0, "memoryReservation": 2048 /-XX:MaxMetaspaceSize=512m -Xmx2500m

Test Runs 

Test configurations #

MSK instance type

Brokers #

Replication factor

Partitions online #

Partitions in replicas #

Scenario

Load level

Test configurations #

MSK instance type

Brokers #

Replication factor

Partitions online #

Partitions in replicas #

Scenario

Load level

1

kafka.m7g.xlarge KRaft

2, 6, 8

2

~100k (96426)

~50k (48062)

192852

96124

CICO + DI MARC Bib Create

 5 users + 1 single record concurrently on 15 tenants + 10k on 1 tenant

2

kafka.m7g.xlarge KRaft

4

2

~50k (55872)

111748

CICO + DI MARC Bib Create

 5 users + 1 single record concurrently on 15 tenants + 10k on 1 tenant, 10k on 15 tenants

3

kafka.m7g.xlarge KRaft

6

2

~50k (55872)

111748

CICO + DI MARC Bib Create

 5 users + 1 single record concurrently on 15 tenants + 10k on 1 tenant

Test Results

  • 1'st test kafka.m7g.xlarge, 2 brokers, total topics: 6690, total partitions: 48062 - qcpt pointed to MSK cluster

    • MSK CPU utilization- 85%

    • MSK Disk usage - 0.5%

    • Check-out flow - 1.6 seconds without data import, 1.4 sec with data import

    • Data import Create job profile with 10k file on 1 tenant - 46 minutes completed successfully

    • Data import on 15 tenants concurrently - last longer than 4 hours and completed with errors (No actions reason)

  • 2'nd test kafka.m7g.xlarge, 6 brokers, total topics: 7335, total partitions: 96426 - qcpt + qcon pointed to MSK cluster

    • MSK CPU utilization - 93% - not stable

    • Check-out flow - no possibility to start testing

    • DI - no possibility to start testing

  • 3'rd test kafka.m7g.xlarge, 8 brokers, total topics: 7335, total partitions: 96426 - qcpt + qcon pointed to MSK cluster

    • MSK CPU utilization - 67% - 1,2 brokers, 45% - 3,4,5,6,7,8 brokers

    • Check-out flow - 1.1 seconds

    • Data import 1 single record 15 tenants duration - 55 seconds

  • 4'th test (retest of test #3 after brokers reboot) kafka.m7g.xlarge, 8 brokers, total topics: 7335, total partitions: 96426 - qcpt + qcon pointed to MSK cluster

    • MSK CPU utilization - 90% - 1,2 brokers, 70% - 3,4,5,6,7,8 brokers - was unstable for an hour, after stabilization tests completed successfully

    • Check-out flow - 1.6 seconds

    • Data import 1 single record 15 tenants duration - 44 seconds

    • Data import Create job profile with 10k file on 1 tenant - 16 minutes completed successfully

  • 5'th test kafka.m7g.xlarge, 4 brokers, total topics: 6743, total partitions: online - 55872 In sync replicas - 111748 - qcpt pointed to MSK cluster

    • MSK CPU utilization - 79% 1,2 brokers, 62% - 9, 10 brokers

    • MSK CPU utilization with Data import 10k - 89% all brokers

    • Check-out flow -  1.1 seconds

    • Data import 1 single record 15 tenants duration - 1 minutes 20 seconds

    • Data import Create job profile with 10k file on 1 tenant - 10 minutes

    • Data import Create job profile with 10k file on 15 tenants- 2 hours 25 minutes

  • 6'th test kafka.m7g.xlarge, 6 brokers, total topics: 6743, total partitions: online - 55872 In sync replicas - 111748 - qcpt pointed to MSK cluster

    • MSK CPU utilization with DI single record - 70% 1,2 brokers, 60% - 9, 10, 11, 12 brokers

    • MSK CPU utilization with Data import 10k - 85% 

    • Check-out flow - 1,2 seconds

    • Data import 1 single record 15 tenants duration - 1 minutes 40 seconds

    • Data import Create job profile with 10k file on 1 tenant - 6 minutes 40 seconds

    • Data import Create job profile with 10k file on 15 tenants - 1 hour 30 minutes, completed successfully on all tenants

  • 7'th test kafka.m7g.xlarge, 6 brokers, total topics: 6743, total partitions: online - 55872 In sync replicas - 111748 - qcpt pointed to MSK cluster. Retest #6 with additional load by message creation script (./folio-topics-load-messages.sh  NUM_RECORDS=100000).

    • mod-pubsub-b module play important role during testing and affect CPU utilization of MSK brokers.

    • MSK CPU utilization with DI single record - 52% 1,2 brokers, 37% - 9, 10, 11, 12 brokers

    • MSK CPU utilization with Data import 10k - 70% 

    • Check-out flow -  1.1 seconds

    • Data import 1 single record 15 tenants duration - 1 minutes 10 seconds

    • Data import Create job profile with 10k file on 1 tenant - 6 min 20 seconds

Response time

 

 

1'st Test

Start Time "8/7/24, 9:33 AM"
End Time "8/7/24, 9:53 AM"

2'd Test

Start Time "8/7/24, 10:47 AM"
End Time "8/7/24, 11:47 AM"

3'd Test

Start Time "8/7/24, 12:41 PM"
End Time "8/7/24, 1:42 PM"

4'th Test

Start Time "8/16/24, 9:09 AM"
End Time "8/16/24, 10:09 AM"

5'th Test ?

Start Time "8/8/24, 9:19 AM"
End Time "8/8/24, 10:20 AM"

6'th Test

Start Time "8/13/24, 10:10 AM"
End Time "8/13/24, 11:10 AM"

7'th Test

Start Time "8/14/24, 12:01 PM"
End Time "8/14/24, 1:01 PM"

8'th Test

Start Time "8/16/24, 9:09 AM"
End Time "8/16/24, 10:09 AM"

11'th Test - 4 brokers, online partitions: ~50k, replication factor: 2

Start Time "8/16/24, 2:16 PM"
End Time "8/16/24, 3:16 PM"

12'th Test - 6 brokers, online partitions: ~50k, replication factor: 2

Start Time "8/19/24, 9:44 AM"
End Time "8/19/24, 10:44 AM"

16'th Test - 6 brokers, online partitions: ~50k, replication factor: 2

Start Time "8/23/24, 12:10 PM"
End Time "8/23/24, 1:10 PM"

 

 

1'st Test

Start Time "8/7/24, 9:33 AM"
End Time "8/7/24, 9:53 AM"

2'd Test

Start Time "8/7/24, 10:47 AM"
End Time "8/7/24, 11:47 AM"

3'd Test

Start Time "8/7/24, 12:41 PM"
End Time "8/7/24, 1:42 PM"

4'th Test

Start Time "8/16/24, 9:09 AM"
End Time "8/16/24, 10:09 AM"

5'th Test ?

Start Time "8/8/24, 9:19 AM"
End Time "8/8/24, 10:20 AM"

6'th Test

Start Time "8/13/24, 10:10 AM"
End Time "8/13/24, 11:10 AM"

7'th Test

Start Time "8/14/24, 12:01 PM"
End Time "8/14/24, 1:01 PM"

8'th Test

Start Time "8/16/24, 9:09 AM"
End Time "8/16/24, 10:09 AM"

11'th Test - 4 brokers, online partitions: ~50k, replication factor: 2

Start Time "8/16/24, 2:16 PM"
End Time "8/16/24, 3:16 PM"

12'th Test - 6 brokers, online partitions: ~50k, replication factor: 2

Start Time "8/19/24, 9:44 AM"
End Time "8/19/24, 10:44 AM"

16'th Test - 6 brokers, online partitions: ~50k, replication factor: 2

Start Time "8/23/24, 12:10 PM"
End Time "8/23/24, 1:10 PM"

Requests

Executions

Response Times (ms)

Executions

Response Times (ms)

Executions

Response Times (ms)

Executions

Response Times (ms)

Executions

Response Times (ms)

Executions

Response Times (ms)

Executions

Response Times (ms)

Executions

Response Times (ms)

Executions

Response Times (ms)

Executions

Response Times (ms)

Response Times (ms)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Label

#Samples

Average

90th pct

95th pct

#Samples

Average

90th pct

95th pct

#Samples

Average

90th pct

95th pct

#Samples

Average

90th pct

95th pct

#Samples

Average

90th pct

95th pct

#Samples

Average

90th pct

95th pct

#Samples

Average

90th pct

95th pct

#Samples

Average

90th pct

95th pct

#Samples

Average

90th pct

95th pct

#Samples

Average

90th pct

95th pct

Average

90th pct

95th pct

CICO_TC_Check-Out Controller_cs00000001_0015

122

1505.3

1750.7

1863.3

406

1414.2

1633.6

1769.2

406

1351.12

1561.9

1709

406

1175.1

1369.8

1498.9

406

1701.7

2318.9

3290.7

407

1132.8

1304.4

1392.6

403

1492.2

1779.4

2400.8

406

1175.1

1369.8

1498.9

406

1173.78

1385.2

1572.9

407

1241.01

1576.2

1747.2

 

 

 

CICO_TC_Check-Out Controller_cs00000001_0014

122

1478.6

1734.4

1894

406

1409.9

1620.5

1765.9

406

1350.8

1584.1

1693

407

1175.1

1362.2

1543.2

406

1661.8

2378.5

3146.6

406

1127.9

1281

1369.7

404

1594.8

1681.5

3296.5

407

1175.1

1362.2

1543.2

407

1165.5

1366.2

1499.6

407

1236.14

1570.4

1710

1144.4

1515.8

1676