lablup / lablup/backend.ai

Introduce memcached and split the check-presets API

Open
#2,546 0 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.