[Ramsons] Migrate/Update large number of Marc Authority records [NON-ECS]
Overview
This document contains the results of testing marc-migration for over 16 mln records in the Ramsons release. https://folio-org.atlassian.net/browse/PERF-929
Summary
- The duration for marc-migration is up to 9,5 hours (7 hours mapping, 2.5 hours saving ) for default configurations with background jobs (e.g. Deleting old records from marc_indexers).
- The best results are for test #9 with CHUNK_FETCH_IDS_COUNT=12000 and RECORDS_CHUNK_SIZE=4000 - total duration 4 hours 2 min (3 hours 35 minutes for data mapping and 27 minutes for data saving).
- Memory utilization increased for mod-entities-links up to 75%, mod-search -62%, and mod-marc-migrations - 60% due to previous module restarting and everyday cluster shutdown processes - no memory leak is suspected for all modules.
- CPU utilization was for mod-entities-links up to 453%, mod-search -20%, mod-marc-migrations - 15%. Average CPU usage did not exceed 10 % for all other modules. But the CPU for mod-marc-migrations is set to 0 and actual CPU usage was about 30% for the AWS instance where mod-marc-migrations was located.
- For all tests, approximate DB CPU usage is up to 70%.
Additional tests
Test with 2 containers (tasks) for mod-marc-migrations and 2 tenants in parallel:
- It does not work for 2 tenants in parallel, even with 2 containers for mod-marc-migrations. The 2nd job will queued with the status - "new" while the 1st is running. The 2nd job will be started and finished successfully after the 1st one.
Test with 1 container (task) for mod-marc-migrations:
- There is no reason to use 2 containers for mod-marc-migrations because the duration for 1 container is the same as for 2 (the process uses only one mod-marc-migrations container of 2 allocated).
Recommendations and Jiras
- Increase default CPU allocation for mod-entities-links service or set it to 0.
- Use CHUNK_FETCH_IDS_COUNT=12000 and RECORDS_CHUNK_SIZE=4000 to decrease migration time, but mod-entities-links will use 25% more CPU.
- Use only 1 container (task) for mod-marc-migrations.
- While the data mapping is running, files with data will be stored directly in the working mod-marc-migrations container. Further, all files will be deleted from the container and relocated to the S3 bucket (if the S3 bucket is not provided - data mapping fails).
If the container falls during the data mapping process - all files will be lost and data mapping will hang forever.
Results
Migrated and saved 16 462 866 records.
Configurations | Duration | |||
---|---|---|---|---|
Test # | CHUNK_FETCH_IDS_COUNT | RECORDS_CHUNK_SIZE | data mapping | data saving |
1 * | default | default | 07:09:31 | 02:27:48 |
2* | 500 | 500 | 06:00:51 | 01:47:44 |
3 | 500 | 500 | 04:48:07 | 01:21:40 |
4 | 2000 | 1000 | 04:14:25 | 00:45:15 |
4a | 2000 | 1000 | 04:10:54 | 00:46:32 |
5 | 4000 | 2000 | 03:42:54 | 00:30:56 |
6 | 5000 | 2500 | 04:05:18 | 00:35:02 |
6a | 5000 | 2500 | 03:58:10 | 00:34:02 |
7 | 7000 | 3500 | 03:40:23 | 00:38:46 |
8 | 10000 | 5000 | 03:34:16 | 00:33:35 |
9 | 12000 | 4000 | 03:35:15 | 00:27:19 |
* - Tests were performed with enabled "Deleting old records from marc_indexers" jobs
4a - repeat of test 4
Additional testing
Tested with 1 container for mod-marc-migrations.
Configurations | Duration | |||
---|---|---|---|---|
Test # | CHUNK_FETCH_IDS_COUNT | RECORDS_CHUNK_SIZE | data mapping | data saving |
10 | 12000 | 4000 | 03:48:11 | 00:29:12 |
Test with 2 containers for mod-marc-migrations and 2 tenants in parallel.
Configurations | Duration | ||||||
---|---|---|---|---|---|---|---|
Test # 11 | Records number | CHUNK_FETCH_IDS_COUNT | RECORDS_CHUNK_SIZE | Started | Finished | data mapping | data saving |
Tenant 1 | 16 462 866 | 12000 | 4000 | 2024-09-17 09:37 | 2024-09-17 13:15 | 03:38:16 | 00:28:18 |
Tenant 2 | 3 514 957 | 12000 | 4000 | 2024-09-17 09:38 (actual mapping start 2024-09-17 13:15) | 2024-09-17 13:49 | 00:34:01 (actual running time) | 00:06:01 |
Resource utilization for Test #9
Memory Utilization
- Memory utilization increased for mod-entities-links up to 75%, mod-search -62%, and mod-marc-migrations - 60% due to previous module restarting and everyday cluster shutdown processes - no memory leak is suspected for all modules.
mod-entities-links, mod-search, mod-marc-migrations
Instance CPU Utilization
Instance CPU Utilization was up to 32%. The red line on the graph is the instance i-063e3abc2c04eb056, where one of the containers of mod-marc-migration is located.
Service CPU Utilization
- CPU utilization was for mod-entities-links up to453%, mod-search -20%, mod-marc-migrations - 15% (It is set to 0 in the configurations). Average CPU usage did not exceed 10 % for all other modules.
mod-entities-links, mod-search, mod-marc-migrations
RDS CPU Utilization
- Approximate DB CPU usage is up to 70%.
RDS Database Connections
Cluster metrics
Appendix
Infrastructure
Records count :
- mod_entities_links.authority = 16462866
PTF -environment rcp1
- 10 m6g.2xlarge EC2 instances located in US East (N. Virginia)us-east-1
1 database instance - writer
Name API Name Memory GIB vCPUs max_connections R6G Extra Large db.r6g.xlarge 32 GiB 4 vCPUs 2731 - MSK fse-tenant
- 4 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
Modules memory and CPU parameters
Cluster Resources - rcp1-pvt (Wed Sep 11 11:00:51 UTC 2024) | |||||||||
Module | Task Definition Revision | Module Version | Task Count | Mem Hard Limit | Mem Soft Limit | CPU Units | Xmx | Metaspace Size | Max Metaspace Size |
mod-remote-storage | 1 | mod-remote-storage:3.2.1-SNAPSHOT.171 | 2 | 4920 | 4472 | 1024 | 3960 | 512 | 512 |
mod-ncip | 1 | mod-ncip:1.14.6-SNAPSHOT.233 | 2 | 1024 | 896 | 0 | 768 | 88 | 128 |
mod-finance-storage | 1 | mod-finance-storage:8.7.0-SNAPSHOT.181 | 2 | 1024 | 896 | 1024 | 700 | 88 | 128 |
mod-agreements | 1 | mod-agreements:7.1.0-SNAPSHOT.237 | 2 | 1592 | 1488 | 0 | 0 | 0 | 0 |
mod-ebsconet | 1 | mod-ebsconet:2.3.0-SNAPSHOT.80 | 2 | 1248 | 1024 | 128 | 700 | 128 | 256 |
mod-organizations | 1 | mod-organizations:2.0.0-SNAPSHOT.93 | 2 | 1024 | 896 | 0 | 700 | 88 | 128 |
edge-sip2 | 1 | edge-sip2:3.3.0-SNAPSHOT.264 | 2 | 1024 | 896 | 0 | 768 | 88 | 128 |
mod-settings | 1 | mod-settings:1.0.4-SNAPSHOT.67 | 2 | 1024 | 896 | 200 | 768 | 88 | 128 |
mod-serials-management | 1 | mod-serials-management:1.1.0-SNAPSHOT.46 | 2 | 2480 | 2312 | 0 | 1792 | 384 | 512 |
edge-dematic | 1 | edge-dematic:2.3.0-SNAPSHOT.143 | 1 | 1024 | 896 | 0 | 768 | 88 | 128 |
mod-data-import | 1 | mod-data-import:3.2.0-SNAPSHOT.189 | 1 | 2048 | 1844 | 256 | 1292 | 384 | 512 |
mod-search | 1 | mod-search:3.3.0-SNAPSHOT.261 | 2 | 2592 | 2480 | 2048 | 1440 | 512 | 1024 |
mod-inn-reach | 1 | mod-inn-reach:3.2.1-SNAPSHOT.102 | 2 | 3600 | 3240 | 1024 | 2880 | 512 | 1024 |
mod-record-specifications | 10 | mod-record-specifications:1.0.0-SNAPSHOT.4 | 2 | 1024 | 896 | 0 | 768 | 88 | 128 |
mod-tags | 1 | mod-tags:2.2.1-SNAPSHOT.138 | 2 | 1024 | 896 | 0 | 768 | 88 | 128 |
mod-authtoken | 1 | mod-authtoken:2.16.0-SNAPSHOT.303 | 2 | 1440 | 1152 | 512 | 922 | 88 | 128 |
edge-courses | 1 | edge-courses:1.5.0-SNAPSHOT.1160 | 2 | 1024 | 896 | 0 | 768 | 88 | 128 |
mod-notify | 1 | mod-notify:3.2.1-SNAPSHOT.268 | 2 | 1024 | 896 | 0 | 768 | 88 | 128 |
mod-inventory-update | 1 | mod-inventory-update:3.4.2-SNAPSHOT.100 | 2 | 1024 | 896 | 0 | 768 | 88 | 128 |
mod-configuration | 1 | mod-configuration:5.11.0-SNAPSHOT.355 | 2 | 1024 | 896 | 0 | 768 | 88 | 128 |
mod-orders-storage | 1 | mod-orders-storage:13.8.0-SNAPSHOT.243 | 2 | 1024 | 896 | 512 | 700 | 88 | 128 |
edge-caiasoft | 1 | edge-caiasoft:2.3.0-SNAPSHOT.105 | 2 | 1024 | 896 | 0 | 768 | 88 | 128 |
mod-login-saml | 1 | mod-login-saml:2.9.0-SNAPSHOT.291 | 2 | 1024 | 896 | 0 | 768 | 88 | 128 |
mod-erm-usage-harvester | 1 | mod-erm-usage-harvester:5.0.0-SNAPSHOT.133 | 2 | 1024 | 896 | 0 | 768 | 88 | 128 |
mod-password-validator | 1 | mod-password-validator:3.2.2-SNAPSHOT.149 | 2 | 1440 | 1298 | 0 | 768 | 384 | 512 |
mod-gobi | 1 | mod-gobi:2.9.0-SNAPSHOT.259 | 2 | 1024 | 896 | 0 | 700 | 88 | 128 |
mod-licenses | 1 | mod-licenses:6.1.0-SNAPSHOT.163 | 2 | 2480 | 2312 | 0 | 1792 | 384 | 512 |
edge-dcb | 1 | edge-dcb:1.2.0-SNAPSHOT.39 | 2 | 1024 | 896 | 0 | 768 | 88 | 128 |
mod-bulk-operations | 1 | mod-bulk-operations:2.1.0-SNAPSHOT.119 | 2 | 3072 | 2600 | 1024 | 1536 | 384 | 512 |
mod-fqm-manager | 3 | mod-fqm-manager:2.1.0-SNAPSHOT.1185 | 2 | 3000 | 2600 | 128 | 2048 | 384 | 512 |
mod-graphql | 1 | mod-graphql:1.12.1.412 | 2 | 1024 | 896 | 0 | 768 | 88 | 128 |
mod-finance | 1 | mod-finance:5.0.0-SNAPSHOT.174 | 2 | 1024 | 896 | 0 | 700 | 88 | 128 |
mod-erm-usage | 1 | mod-erm-usage:5.0.0-SNAPSHOT.109 | 2 | 1024 | 896 | 0 | 768 | 88 | 128 |
mod-batch-print | 1 | mod-batch-print:1.2.0-SNAPSHOT.15 | 2 | 1024 | 896 | 0 | 768 | 88 | 128 |
mod-tlr | 2 | mod-tlr:1.0.0-SNAPSHOT.8 | 2 | 1024 | 896 | 0 | 768 | 88 | 128 |
mod-lists | 2 | mod-lists:2.1.0-SNAPSHOT.1300 | 2 | 1024 | 896 | 0 | 768 | 88 | 128 |
mod-copycat | 1 | mod-copycat:1.6.1-SNAPSHOT.208 | 2 | 1024 | 512 | 0 | 768 | 88 | 128 |
mod-entities-links | 4 | mod-entities-links:3.1.0-SNAPSHOT.113 | 2 | 2592 | 2480 | 400 | 1440 | 0 | 1024 |
mod-permissions | 2 | mod-permissions:6.6.0-SNAPSHOT.385 | 2 | 1684 | 1544 | 512 | 1024 | 384 | 512 |
pub-edge | 1 | pub-edge:2023.06.14 | 2 | 1024 | 896 | 0 | 768 | 0 | 0 |
mod-orders | 1 | mod-orders:12.9.0-SNAPSHOT.398 | 2 | 2048 | 1440 | 1024 | 1024 | 384 | 512 |
edge-patron | 1 | edge-patron:5.2.0-SNAPSHOT.174 | 2 | 1024 | 896 | 256 | 768 | 88 | 128 |
edge-ncip | 1 | edge-ncip:1.10.2-SNAPSHOT.116 | 2 | 1024 | 896 | 0 | 768 | 88 | 128 |
mod-marc-migrations | 22 | mod-marc-migrations:1.0.0-SNAPSHOT.8 | 2 | 1024 | 896 | 0 | 768 | 88 | 128 |
edge-inn-reach | 1 | edge-inn-reach:3.3.0-SNAPSHOT.69 | 2 | 1024 | 896 | 0 | 768 | 88 | 128 |
mod-users-bl | 1 | mod-users-bl:7.9.0-SNAPSHOT.318 | 2 | 1440 | 1152 | 512 | 922 | 88 | 128 |
mod-oa | 1 | mod-oa:2.1.0-SNAPSHOT.66 | 2 | 1024 | 896 | 0 | 768 | 88 | 128 |
mod-invoice | 1 | mod-invoice:5.9.0-SNAPSHOT.205 | 2 | 1440 | 1152 | 512 | 922 | 88 | 128 |
mod-inventory-storage | 2 | mod-inventory-storage:27.2.0-SNAPSHOT.764 | 2 | 4096 | 3690 | 2048 | 3076 | 384 | 512 |
mod-user-import | 1 | mod-user-import:3.9.0-SNAPSHOT.197 | 2 | 1024 | 896 | 0 | 768 | 88 | 128 |
mod-sender | 1 | mod-sender:1.12.1-SNAPSHOT.100 | 2 | 1024 | 896 | 0 | 768 | 88 | 128 |
edge-oai-pmh | 1 | edge-oai-pmh:2.10.0-SNAPSHOT.174 | 2 | 1512 | 1360 | 1024 | 1440 | 384 | 512 |
mod-data-export-worker | 1 | mod-data-export-worker:3.3.0-SNAPSHOT.233 | 2 | 3072 | 2048 | 1024 | 2048 | 384 | 512 |
mod-rtac | 1 | mod-rtac:3.7.0-SNAPSHOT.203 | 2 | 1024 | 896 | 0 | 768 | 88 | 128 |
mod-circulation-storage | 1 | mod-circulation-storage:17.3.0-SNAPSHOT.405 | 2 | 2880 | 2592 | 1536 | 1814 | 384 | 512 |
mod-source-record-storage | 2 | mod-source-record-storage:5.9.0-SNAPSHOT.405 | 2 | 5600 | 5000 | 2048 | 3500 | 384 | 512 |
mod-calendar | 2 | mod-calendar:3.2.0-SNAPSHOT.229 | 2 | 1024 | 896 | 0 | 768 | 88 | 128 |
mod-event-config | 1 | mod-event-config:2.7.2-SNAPSHOT.110 | 2 | 1024 | 896 | 0 | 768 | 88 | 128 |
mod-courses | 1 | mod-courses:1.4.11-SNAPSHOT.155 | 2 | 1024 | 896 | 0 | 768 | 88 | 128 |
mod-circulation-item | 1 | mod-circulation-item:1.0.1-SNAPSHOT.26 | 2 | 1024 | 896 | 0 | 0 | 0 | 0 |
mod-inventory | 1 | mod-inventory:20.3.0-SNAPSHOT.546 | 2 | 2880 | 2592 | 1024 | 1814 | 384 | 512 |
mod-email | 1 | mod-email:1.17.1-SNAPSHOT.128 | 2 | 1024 | 896 | 0 | 768 | 88 | 128 |
mod-requests-mediated | 10 | mod-requests-mediated:1.0.0-SNAPSHOT.4 | 2 | 1024 | 896 | 0 | 768 | 88 | 128 |
mod-di-converter-storage | 1 | mod-di-converter-storage:2.3.0-SNAPSHOT.124 | 2 | 1024 | 896 | 0 | 768 | 88 | 128 |
mod-pubsub | 1 | mod-pubsub:2.15.0-SNAPSHOT.224 | 2 | 1536 | 1440 | 1024 | 922 | 384 | 512 |
mod-circulation | 1 | mod-circulation:24.3.0-SNAPSHOT.681 | 2 | 2880 | 2592 | 1536 | 1814 | 384 | 512 |
edge-orders | 1 | edge-orders:3.1.0-SNAPSHOT.156 | 2 | 1024 | 896 | 0 | 768 | 88 | 128 |
edge-rtac | 1 | edge-rtac:2.7.3-SNAPSHOT.234 | 2 | 1024 | 896 | 0 | 768 | 88 | 128 |
mod-template-engine | 1 | mod-template-engine:1.20.1-SNAPSHOT.118 | 2 | 1024 | 896 | 0 | 768 | 88 | 128 |
mod-users | 1 | mod-users:19.3.2-SNAPSHOT.696 | 2 | 1024 | 896 | 0 | 768 | 88 | 128 |
mod-patron-blocks | 1 | mod-patron-blocks:1.11.0-SNAPSHOT.163 | 2 | 1024 | 896 | 1024 | 768 | 88 | 128 |
mod-audit | 1 | mod-audit:2.9.1-SNAPSHOT.216 | 2 | 1024 | 896 | 0 | 768 | 88 | 128 |
edge-fqm | 1 | edge-fqm:2.1.0-SNAPSHOT.100 | 2 | 1024 | 896 | 0 | 768 | 88 | 128 |
mod-source-record-manager | 1 | mod-source-record-manager:3.9.0-SNAPSHOT.353 | 2 | 5600 | 5000 | 2048 | 3500 | 384 | 512 |
nginx-edge | 1 | nginx-edge:2023.06.14 | 2 | 1024 | 896 | 0 | 0 | 0 | 0 |
mod-quick-marc | 1 | mod-quick-marc:5.2.0-SNAPSHOT.153 | 1 | 2288 | 2176 | 0 | 1664 | 384 | 512 |
nginx-okapi | 1 | nginx-okapi:2023.06.14 | 2 | 1024 | 896 | 0 | 0 | 0 | 0 |
okapi-b | 1 | okapi:5.3.0 | 3 | 1684 | 1440 | 1024 | 922 | 384 | 512 |
mod-feesfines | 1 | mod-feesfines:19.2.0-SNAPSHOT.198 | 2 | 1024 | 896 | 0 | 768 | 88 | 128 |
mod-invoice-storage | 1 | mod-invoice-storage:5.9.0-SNAPSHOT.138 | 2 | 1872 | 1536 | 1024 | 1024 | 384 | 512 |
mod-reading-room | 2 | mod-reading-room:1.0.0-SNAPSHOT.12 | 2 | 1024 | 896 | 0 | 768 | 88 | 128 |
mod-service-interaction | 1 | mod-service-interaction:4.1.0-SNAPSHOT.126 | 2 | 2048 | 1844 | 256 | 1290 | 384 | 512 |
mod-dcb | 1 | mod-dcb:1.1.3-SNAPSHOT.40 | 2 | 1024 | 896 | 0 | 768 | 88 | 128 |
mod-data-export | 1 | mod-data-export:5.1.0-SNAPSHOT.240 | 1 | 2048 | 1524 | 1024 | 0 | 0 | 0 |
mod-patron | 1 | mod-patron:6.2.0-SNAPSHOT.165 | 2 | 1024 | 896 | 0 | 768 | 88 | 128 |
mod-oai-pmh | 1 | mod-oai-pmh:3.14.0-SNAPSHOT.402 | 2 | 4096 | 3690 | 2048 | 3076 | 384 | 512 |
edge-connexion | 1 | edge-connexion:1.4.0-SNAPSHOT.88 | 2 | 1024 | 896 | 0 | 768 | 88 | 128 |
mod-notes | 1 | mod-notes:5.3.0-SNAPSHOT.325 | 2 | 1024 | 896 | 0 | 952 | 384 | 512 |
mod-kb-ebsco-java | 1 | mod-kb-ebsco-java:4.2.0-SNAPSHOT.178 | 2 | 1024 | 896 | 0 | 768 | 88 | 128 |
mod-login | 1 | mod-login:7.12.0-SNAPSHOT.324 | 2 | 1440 | 1298 | 1024 | 768 | 384 | 512 |
mod-organizations-storage | 1 | mod-organizations-storage:4.8.0-SNAPSHOT.131 | 2 | 1024 | 896 | 0 | 700 | 88 | 128 |
mod-data-export-spring | 1 | mod-data-export-spring:3.3.1-SNAPSHOT.167 | 1 | 2048 | 1844 | 256 | 1536 | 384 | 512 |
pub-okapi | 1 | pub-okapi:2023.06.14 | 2 | 1024 | 896 | 0 | 768 | 0 | 0 |
mod-eusage-reports | 1 | mod-eusage-reports:3.0.0-SNAPSHOT.73 | 2 | 1024 | 896 | 0 | 768 | 88 | 128 |
Methodology/Approach
To test Baseline for marc-migration JMeter scripts were used.
Test preparation:
- Background 'Deleting old records from marc_indexers' jobs were disabled:
added configuration to mod-source-record-storage{ "name": "srs.marcIndexers.delete.interval.seconds", "value": "86400" },
- 16 mln Marc Authority records added to the database
Check Migration Operation from the database:
- select end_time_mapping - start_time_mapping as mapping_duration,end_time_saving - start_time_saving as saving_duration,* from {tenant}_mod_marc_migrations.operation order by start_time_mapping desc
More info workflows-scripts/marc-migration/readme.md