hasura / hasura/graphql-engine

Monitoring: incorrect max connection pool size shown for read replicas

Open
#9,002 1 comment 0 reactions 0 assignees View on GitHub
k/bug p/high t/control-plane
Dominant language
TypeScript
Stars
32.1k
Forks
3k
PR merge metrics
PR metrics pending

Description

### Version Information

Server Version: 2.11.2

### Environment

Cloud

### What is the current behavior?

Monitoring tab shows read replica max connection pool to be 20. This is incorrect per the configuration.

Interestingly this problem only occurred when a second read replica was added.

Unsure at this stage if this is a UI issue, a monitoring issue, or an issue with pooling logic.

### What is the expected behavior?

Given the following configuration, we expect read replica max connection pool to be 10 (5 configured max * 2 workers)

```yaml
- name: pg_chinook
kind: postgres
configuration:
connection_info:
database_url:
from_env: PG_CHINOOK_DATABASE_URL
isolation_level: read-committed
pool_settings:
connection_lifetime: 600
max_connections: 5
use_prepared_statements: false
read_replicas:
- database_url:
from_env: PG_CHINOOK_READONLY_1_DATABASE_URL
isolation_level: read-committed
pool_settings:
connection_lifetime: 600
max_connections: 5
use_prepared_statements: false
- database_url:
from_env: PG_CHINOOK_READONLY_2_DATABASE_URL
isolation_level: read-committed
pool_settings:
connection_lifetime: 600
max_connections: 5
use_prepared_statements: false
tables: "!include pg_chinook/tables/tables.yaml"
```

### Screenshots or Screencast

Correct pool size for main db
![image](https://user-images.githubusercontent.com/25712958/192186757-3656b2c7-e120-43c7-ac90-4ac6941762cd.png)
Incorrect pool size for read replica 1
![image](https://user-images.githubusercontent.com/25712958/192186813-423ba7b8-2b1e-4741-b206-2ed32d6869aa.png)
Incorrect pool size for read replica 2
![image](https://user-images.githubusercontent.com/25712958/192186891-86ceea80-bee2-4ccf-a4ac-fe73fe76ac6b.png)

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.