-
Notifications
You must be signed in to change notification settings - Fork 137
Labels
Description
Problem
As a result of the performed testing in #12164 the following observations were made:
- Among all record files the latest one is read the most frequently. It is always the same for all requests in the 2-second window that is valid. Currently it is cached for 500ms and this can be increased up to 2s or at least 1s as we don't need it refreshed that frequently.
- There are way too many DB requests that are made concurrently to read the latest record file before it gets cached. In numbers: with only 20% of the real world traffic over a 20-second period there are over 850 actual DB queries (not repository calls) for the latest record file. Even in 3-4 ms period about 20 actual DB calls are made (the average time for the repository call completion is about 80ms). This takes 20 DB connections from the pool that can be used for other queries that are really needed.
Solution
Find a way to optimize the record file DB queries. Ideally, only 1 thread should make the call for the latest record file and all others should just wait for it and read it. Then after 2 seconds when the file expires, it needs to be read again.
Another suggestion is to make the repository call lazily and skip the record file reading wherever possible.
Alternatives
No response
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
👷 In progress