tencent cloud

TencentDB for PostgreSQL

Release Notes and Announcements
Release Notes
Product Announcements
Product Introduction
Overview
Features
Strengths
Scenarios
Information Security
Regions and AZs
Product Feature List
Large version lifecycle description
MSSQL Compatible Version
Billing
Billing Overview
Instance Type and Specification
Purchase Methods
Refund
Overdue Payments
Backup Space Billing
Database Audit Billing Overview
Getting Started
Creating TencentDB for PostgreSQL Instance
Connecting to TencentDB for PostgreSQL Instance
Managing TencentDB for PostgreSQL Instance
Importing Data
Migrating Data with DTS
Kernel Version Introduction
Kernel Version Overview
Kernel Version Release Notes
Viewing Kernel Version
Proprietary Kernel Features
Database Audit
Audit Service Description
Activating Audit Service
View Audit Logs
Modify audit services
Audit Performance Description
User Guide
Instance Management
Upgrading Instance
CPU Elastic Scaling
Read-Only Instance
Account Management
Database Management
Parameter Management
Log Management and Analysis
Backup and Restoration
Data Migration
Extension Management
Network Management
Access Management
Data Security
Tenant and Resource Isolation
Security Groups
Monitoring and Alarms
Tag
AI Practice
Using the Tencentdb_ai Plug-In to Call Large Models
Building Ai Applications with the Tencentdb Ai Plug-In
Combining Supabase to Quickly Build Backend Service Based on TencentDB for PostgreSQL
Use Cases
postgres_fdw Extension for Cross-database Access
Automatically Creating Partition in PostgreSQL
Searching in High Numbers of Tags Based on pg_roaringbitmap
Querying People Nearby with One SQL Statement
Configuring TencentDB for PostgreSQL as GitLab's External Data Source
Supporting Tiered Storage Based on cos_fdw Extension
Implement Read/Write Separation via pgpool
Implementing Slow SQL Analysis Using the Auto_explain Plugin
Using pglogical for Logical Replication
Using Debezium to Collect PostgreSQL Data
Set Up a Remote Disaster Recovery Environment for PostgreSQL Locally on CVM
Read-Only Instance and Read-Only Group Practical Tutorial
How to Use SCF for Scheduled Database Operations
Fix Table Bloat
Performance White Paper
Test Methods
Test Results
API Documentation
History
Introduction
API Category
Making API Requests
Instance APIs
Read-Only Instance APIs
Backup and Recovery APIs
Parameter Management APIs
Security Group APIs
Performance Optimization APIs
Account APIs
Specification APIs
Network APIs
Data Types
Error Codes
FAQs
Service Agreement
Service Level Agreement
Terms of Service
Glossary
Contact Us

Setting soft_limit_connections Parameters

PDF
Modo Foco
Tamanho da Fonte
Última atualização: 2024-10-28 15:03:30
Due to the needs of primary-secondary replication, the max_connections parameter value of the secondary database in PostgreSQL, must be greater than or equal to that of the primary database in it. Therefore, the max_connections parameter value of the primary instance may not be set to the maximum value allowed by its specification due to the configuration of the read-only instance and the primary instance. At this point, you can resolve this issue by enabling the soft_limit_connections parameter. Below, we will describe this in detail.
Note:
When the soft_limit_connections parameter is set to a value other than -1, the number of connections to the instance will be controlled by this parameter. If your TencentDB for PostgreSQL instance does not have any restrictions, it is recommended not to modify this parameter.
Suppose you now have a primary instance and two read-only instances. The configurations are as follows:
Instance Type
Instance Configuration
Maximum max_connections Value
Primary instance
8 CPU cores and 48 GB memory with 100 GB disk
4500
Read-only instance
1 CPU core and 2 GB memory with 100 GB disk
2048
Read-only instance
1 CPU core and 2 GB memory with 100 GB disk
2048
If you need to adjust the connection count of the primary instance to 4000, you can perform the following operation:
1. Modify the soft_limit_connections of all read-only instances
You can modify the soft_limit_connections parameter of the read-only instance to a value other than -1, then the connection count of the read-only instance will be controlled by the soft_limit_connections parameter. Modifying this parameter does not require a restart. You can search for soft_limit_connections in the Parameter Settings to change it, as shown below:

2. Modify the max_connections of all read-only instances
After modifying the soft_limit_connections parameter of the read-only instance to a value other than -1, the maximum limit of the max_connections parameter of the read-only instance will be consistent with that of the primary instance. Since the max_connections parameter value of the secondary database must be greater than or equal to that of the primary database, if you need to adjust the max_connections of the primary instance, you can first adjust the max_connections of the read-only instance to prepare for adjusting the max_connections of the primary instance later. You can search for max_connections in the Parameter Settings to change it, as shown below:

3. Modify the max_connections of the primary instance
If the max_connections of all read-only instances has been adjusted and you now want to adjust the connection limit of the primary instance to a higher value, you can directly modify the max_connections parameter of the primary instance. You can search for max_connections in the Parameter Settings to change it, as shown below:

At this point, the maximum connection count of your primary instance has been adjusted and is no longer limited by the specifications of the read-only instances.
If you no longer need to use the soft_limit_connections parameter to control the connection count of the read-only instances, you can follow the steps below to disable the parameter.
Modify the max_connections parameter of the primary instance to 2048
Modify the max_connections parameter of all read-only instances to 2048
Set the soft_limit_connections parameter of all read-only instances to -1

Ajuda e Suporte

Esta página foi útil?

comentários