Introduce memcached and split the check-presets API
- Dominant language
- Python
- Stars
- 670
- Forks
- 183
- Avg merge
- 17h 7m
- Merged PRs (30d)
- 358
Description
Currently, our frontend is heavily using the check-presets API in many places, including when polling the current system resource usage.
This API is very heavy in terms of database transactions because it locks sessions, agents, groups, keypairs tables as a single read-only transaction.
Let's split this API into two which internally uses the same query underneath:
- check-presets: Just return the filtered resource preset list for the session creation UI. Infrequently invoked.
- check-resources: Return the full resource usage information. Frequently invoked and should be **heavily cached**.\* Add an option to bypass the cache, for cases when the client/frontend needs manual updates.
To achieve this, let's introduce memcached as a database caching backend with [aiomcache](https://github.com/aio-libs/aiomcache).
This issue overrides #2366.
JIRA Issue: BA-106
Contributor guide
Assessment
This issue has not been assessed yet.