Azure Database for PostgreSQL(单一服务器)中的限制Limits in Azure Database for PostgreSQL - Single Server

下列各部分介绍数据库服务中的容量和功能限制。The following sections describe capacity and functional limits in the database service. 如果想了解资源(计算、内存、存储)层,请参阅定价层一文。If you'd like to learn about resource (compute, memory, storage) tiers, see the pricing tiers article.

最大连接数Maximum connections

每个定价层的最大连接数和 vCore 数如下所示。The maximum number of connections per pricing tier and vCores are shown below. Azure 系统需要使用五个连接来监视 Azure Database for PostgreSQL 服务器。The Azure system requires five connections to monitor the Azure Database for PostgreSQL server.

定价层Pricing Tier vCore(s)vCore(s) 最大连接数Max Connections 最大用户连接数Max User Connections
基本Basic 11 5555 5050
基本Basic 22 105105 100100
常规用途General Purpose 22 150150 145145
常规用途General Purpose 44 250250 245245
常规用途General Purpose 88 480480 475475
常规用途General Purpose 1616 950950 945945
常规用途General Purpose 3232 15001500 14951495
常规用途General Purpose 6464 19001900 18951895
内存优化Memory Optimized 22 300300 295295
内存优化Memory Optimized 44 500500 495495
内存优化Memory Optimized 88 960960 955955
内存优化Memory Optimized 1616 19001900 18951895
内存优化Memory Optimized 3232 19871987 19821982

当连接数超出限制时,可能会收到以下错误:When connections exceed the limit, you may receive the following error:

严重:很抱歉,客户端数过多FATAL: sorry, too many clients already


为了获得最佳体验,我们建议你使用 pgBouncer 之类的连接池来有效地管理连接。For best experience, we recommend that you use a connection pooler like pgBouncer to efficiently manage connections.

PostgreSQL 连接,即使空闲,也可以占用大约 10MB 的内存。A PostgreSQL connection, even idle, can occupy about 10MB of memory. 而且,创建新连接需要时间。Also, creating new connections takes time. 大多数应用程序请求许多生存期短的连接,这加剧了这种情况。Most applications request many short-lived connections, which compounds this situation. 其结果是可用于实际工作负荷的资源减少,从而导致性能下降。The result is fewer resources available for your actual workload leading to decreased performance. 连接池程序不仅会减少空闲连接,还会重用现有连接,因而有助于避免这种情况。A connection pooler that decreases idle connections and reuses existing connections will help avoid this.

功能限制Functional limitations

缩放操作Scale operations

  • 目前不支持动态缩放到“基本”定价层或从该层动态缩放。Dynamic scaling to and from the Basic pricing tiers is currently not supported.
  • 目前不支持减小服务器存储大小。Decreasing server storage size is currently not supported.

服务器版本升级Server version upgrades

  • 目前不支持在主要数据库引擎版本之间进行自动迁移。Automated migration between major database engine versions is currently not supported. 如果要升级到下一个主版本,请进行转储并将其还原到使用新引擎版本创建的服务器。If you would like to upgrade to the next major version, take a dump and restore it to a server that was created with the new engine version.

请注意,在 PostgreSQL 版本 10 之前,PostgreSQL 版本控制策略主版本 升级视为第一个 第二个数字的增加(例如,9.5 到 9.6 视为 版本升级)。Note that prior to PostgreSQL version 10, the PostgreSQL versioning policy considered a major version upgrade to be an increase in the first or second number (for example, 9.5 to 9.6 was considered a major version upgrade). 从版本 10 开始,只有第一个数字的更改才视为主版本升级(例如,10.0 到 10.1 是 次要 版本升级,10 到 11 是 版本升级)。As of version 10, only a change in the first number is considered a major version upgrade (for example, 10.0 to 10.1 is a minor version upgrade, and 10 to 11 is a major version upgrade).

VNet 服务终结点VNet service endpoints

  • 只有常规用途和内存优化服务器才支持 VNet 服务终结点。Support for VNet service endpoints is only for General Purpose and Memory Optimized servers.

还原服务器Restoring a server

  • 使用 PITR 功能时,将使用与新服务器所基于的服务器相同的定价层配置创建新服务器。When using the PITR feature, the new server is created with the same pricing tier configurations as the server it is based on.
  • 还原期间创建的新服务器没有原始服务器上存在的防火墙规则。The new server created during a restore does not have the firewall rules that existed on the original server. 需要为此新服务器单独设置防火墙规则。Firewall rules need to be set up separately for this new server.
  • 不支持还原已删除的服务器。Restoring a deleted server is not supported.

Windows 上的 UTF-8 字符UTF-8 characters on Windows

  • 在某些情况下,Windows 上的开源 PostgreSQL 不完全支持 UTF-8 字符,这会影响 Azure Database for PostgreSQL。In some scenarios, UTF-8 characters are not supported fully in open source PostgreSQL on Windows, which affects Azure Database for PostgreSQL. 有关详细信息,请参阅 postgresql-archive 中的 Bug #15476 上的话题。Please see the thread on Bug #15476 in the postgresql-archive for more information.

GSS 错误GSS error

如果看到与 GSS 相关的错误,则你可能使用的是 Azure Postgres 单一服务器尚不完全支持的较新客户端/驱动程序版本。If you see an error related to GSS, you are likely using a newer client/driver version which Azure Postgres Single Server does not yet fully support. 已知此错误会影响 JDBC 驱动程序版本 42.2.15 和 42.2.16This error is known to affect JDBC driver versions 42.2.15 and 42.2.16.

  • 我们计划在 11 月底之前完成更新。We plan to complete the update by the end of November. 在此期间,请考虑使用正在工作的驱动程序版本。Consider using a working driver version in the meantime.
  • 或者,考虑禁用 GSS 请求。Or, consider disabling the GSS request. 使用连接参数,例如 gssEncMode=disableUse a connection parameter like gssEncMode=disable.

存储大小缩减Storage size reduction

无法减小存储大小。Storage size cannot be reduced. 你必须创建一个具有所需存储大小的新服务器,执行手动转储和还原,然后将数据库迁移到新服务器。You have to create a new server with desired storage size, perform manual dump and restore and migrate your database(s) to the new server.

后续步骤Next steps