lablup / lablup/backend.ai

Create a manager API to monitor DB connection pools and other relevant database metrics.

Open
#2,984 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

### Main idea

Since it’s challenging to visibly track DB connection pools, Let's create manager API to monitor DB connections such as `max_connections`, `used`, `res_for_super`, `res_for_normal`.

You can check the `max_connections`, `used`, `res_for_super`, `res_for_normal` using below command.
```
select max_conn,used,res_for_super,max_conn-used-res_for_super res_for_normal from (select count(*) used from pg_stat_activity) t1, (select setting::int res_for_super from pg_settings where name=$$superuser_reserved_connections$$) t2, (select setting::int max_conn from pg_settings where name=$$max_connections$$) t3;
```
![Image](https://github.com/user-attachments/assets/98632725-7e5a-4dca-8d73-63a5a91a4dfa)

ref) https://teams.microsoft.com/l/message/19:b8327ceb372045beb1d0c6e28ca281da@thread.skype/1730080451689?tenantId=13c6a44d-9b52-4b9e-aa34-0513ee7131f2&groupId=483daa8a-29ee-4085-9f71-e93d7f112730&parentMessageId=1727416210374&teamName=project&channelName=KTCloud%20NPU&createdTime=1730080451689

### Alternative ideas

_No response_

### Anything else?

_No response_

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.