mod-source-record-storage performance for standard requests on big database.
1. For measuring srs(mod-source-record-storage) performance was created and deployed testing vagrant-box locally. It has specific resources: vb.cpus = 3, vb.memory = "20000". SRS has maximum heap zise parameter: -Xmx256m
2. The database for srs(diku_mod_source_record_storage schema) was filled via 100_000 records. So, tables "records_lb", "raw_records_lb", "marc_records_lb" contains 100_000 records.
Record example from "records_lb"-table:
id | snapshot_id | matched_id | generation | record_type | instance_id | state | leader_record_status | order | suppress_discovery | created_by_user_id | created_date | updated_by_user_id | updated_date | instance_hrid |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
| 0 | MARC |
| ACTUAL | c | <null> | false | <null> |
| <null> |
|
|
Record example from "raw_records_lb"-table:
id | content |
|---|---|
|
|
Record example from "marc_records_lb"-table:
id | content |
|---|---|
2b55fe13-c4f4-40f1-b6b5-cce5c706635b |
|
So, there are 100_000 the same records (with other UUIDs) for each of this tables.
3. Let`s measure response time for standard GET-endpoints in srs for 100_000 records. There will be 10 requests without timeout between them, and will be calculated average time for specific request. Moreover, first request always slower then other ones.
- /source-storage/records/{id} :
Average time=50ms:
- /source-storage/records:
Parameters: Limit = 1000
Average time=4818ms(4.8seconds):
- /source-storage/records/{id}/formatted:
Average time=73ms:
- /source-storage/source-records/{id}:
Average time=61ms:
- /source-storage/source-records:
Parameters: Limit = 1000
Average time=1266ms (1.27seconds):
After this measuring, DB was filled with 500_000 records (with the same contents) for checking the difference. Resources are the same.
/source-storage/records/{id}: Average = 171ms(VS 50ms for 100_000 records)
/source-storage/records: Average = The same as for 100_000 records
/source-storage/records/{id}/formatted: Average = The same as for 100_000 records
/source-storage/source-records: Average = 1513ms(VS 1266ms for 100_000 records)
/source-storage/source-records/{id}: Average = The same as for 100_000 records