View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0000715 | Pgpool-II | General | public | 2021-05-24 14:58 | 2021-06-22 11:41 |
| Reporter | manikan | Assigned To | pengbo | ||
| Priority | high | Severity | major | Reproducibility | N/A |
| Status | closed | Resolution | open | ||
| Product Version | 4.2.3 | ||||
| Summary | 0000715: PgPool Loadbalancer in Kubernetes | ||||
| Description | Hi, This is the first time trying to use PgPool. Planning to setup a PgPool to load balance between Google Cloud SQL primary and read replicas. Scenario: If the max connections of primary and read replicas instances are set to 200 individually. So if we setup the num_init_children to 400 and max_pool to 1 which can accept max of 400 connections totally by PgPool. For the above scenario, say for an example, at a given time, the number of primary connection is 200 and read replicas is 100 Now if a write request is asking for a connection and all 200 connections of primary instance are in use, PgPool will try to create a connection because the number of max connection is less than 400. In this case, cloud SQL will thrown an error that it is reached the max limit. Can you please let me know on how can we set the max connections at individual Postgres instance level instead of overall level via num_init_children and max_pool in case of load balance usage? | ||||
| Tags | No tags attached. | ||||
|
|
> Can you please let me know on how can we set the max connections at individual Postgres instance level instead of overall level via num_init_children and max_pool in case of load balance usage? You need to configure max_pool, num_init_children, max_connections and superuser_reserved_connections to satisfy: number of Pgpool-II replicas × max_pool × num_init_children <= (max_connections - superuser_reserved_connections) |
|
|
But for the scenario which I have explained should have the max connection of 400 connections (200 max connections of primary and 200 max connections of read replicas) set at PgPool level. Say for an example, at a given point of time, primary instance is already having 200 concurrent connections and read replicas is having 100 concurrent connections. In this case, if the client try to ask PgPool to give me one more connection for Primary instance, PgPool will try to create one more connection, this is because the current max connections between primary and read replica is less than the max connection set at the PgPool level but if you note that it's have already reached the max connection for primary instance. That's why asked the question on how PgPool will track an individual instance max connection? |
|
|
> But for the scenario which I have explained should have the max connection of 400 connections (200 max connections of primary and 200 max connections of read replicas) set at PgPool level. I think you may have misunderstood the connections between Pgpool-II and PostgreSQL. If client connects to Pgpool-II, then Pgpool-II will create connections to each PostgreSQL (Service). About the connections between Pgpoo-II and PostgreSQL, please see to attachment. |
|
|
Thanks for the info. Quick question to understand it. Based on the picture, max connections is configured at Postgres server level as 300 for each individual instances (primary, read replica 1 and read replica 3), so totally PgPool need to cache 900 connections right? If so, configuring num_init_children as 300 should be fine? Whether PgPool will internally cache 900 connections for all instances (300 for each instance)? |
|
|
> Based on the picture, max connections is configured at Postgres server level as 300 for each individual instances (primary, read replica 1 and read replica 3), so totally PgPool need to cache 900 connections right? Yes. > If so, configuring num_init_children as 300 should be fine? Whether PgPool will internally cache 900 connections for all instances (300 for each instance)? num_init_children = 300 should be fine. In this case, Pgpool-II will cache up to 900 connections. If there are no requests from application, Pgpool-II doesn't create and cache connections in advance. |
|
|
Have you resolved this issue? May I close this issue? |
|
|
Close issue. |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2021-05-24 14:58 | manikan | New Issue | |
| 2021-05-25 00:50 | pengbo | Note Added: 0003849 | |
| 2021-05-25 00:50 | pengbo | Assigned To | => pengbo |
| 2021-05-25 00:50 | pengbo | Status | new => feedback |
| 2021-05-25 01:18 | manikan | Note Added: 0003851 | |
| 2021-05-25 01:18 | manikan | Status | feedback => assigned |
| 2021-05-25 15:19 | pengbo | Note Added: 0003855 | |
| 2021-05-25 15:19 | pengbo | File Added: max_connections.pptx | |
| 2021-05-25 15:20 | pengbo | Status | assigned => feedback |
| 2021-05-25 22:11 | manikan | Note Added: 0003856 | |
| 2021-05-25 22:11 | manikan | Status | feedback => assigned |
| 2021-05-27 11:29 | pengbo | Note Added: 0003858 | |
| 2021-06-01 13:00 | pengbo | Status | assigned => feedback |
| 2021-06-08 13:55 | pengbo | Note Added: 0003870 | |
| 2021-06-22 11:41 | pengbo | Note Added: 0003881 | |
| 2021-06-22 11:41 | pengbo | Status | feedback => closed |