PostgreSQL 商用版本EPAS(阿里云ppas(Oracle 兼容版)) 自动(postgresql.conf)参数计算与适配功能

less than 1 minute read

背景

PostgreSQL商用版本EnterpriseDB,内置了自动参数计算与适配功能(或者称之为负载(OLTP, OLAP, MIX)自适应功能,以及使用多少硬件资源)。

根据两个参数(edb_dynatune, edb_dynatune_profile)的配置,数据库在启动时,自动设置其他与负载相关的参数(buffer、work_mem、成本因子、自动垃圾回收相关参数、等等)。

自动参数计算与适配

使用多少硬件资源

比如说,数据库所在的服务器,除了给数据库使用,还给应用使用,那么数据库参数配置时,应该考虑到扣除一些资源给其他服务使用。

这就是资源使用比例的设置,由参数edb_dynatune控制,取值范围0-100。

0表示关闭自动调整功能。

1-100表示数据库将使用这台服务器百分之多少的资源。

  • A low non-zero, value (e.g., 1 - 33) dedicates the least amount of the host machine’s resources to the database server. This setting would be used for a development machine where many other applications are being used.

  • A value in the range of 34 - 66 dedicates a moderate amount of resources to the database server. This setting might be used for a dedicated application server that may have a fixed number of other applications running on the same machine as Advanced Server.

  • The highest values (e.g., 67 - 100) dedicate most of the server’s resources to the database server. This setting would be used for a host machine that is totally dedicated to running Advanced Server.

设置了edb_dynatune后,数据库启动时,将自动计算一些资源相关参数的值(memory, buffer、effective_cache_size 等等),覆盖掉用户在postgresql.conf参数配置中设置的值,作为新的启动参数。

数据库负载偏好

edb_dynatune_profile控制,取值范围枚举({oltp | reporting | mixed})。

  • oltp. Recommended when the database server is processing heavy online transaction processing workloads.

  • reporting. Recommended for database servers used for heavy data reporting.

  • mixed. Recommended for servers that provide a mix of transaction processing and data reporting.

设置了edb_dynatune后,数据库启动时,将自动计算一些相关参数的值(work_mem、成本因子、自动垃圾回收相关参数、等等),覆盖掉用户在postgresql.conf参数配置中设置的值,作为新的启动参数。

小结

根据实际情况设置edb_dynatune, edb_dynatune_profile,可以帮助初级用户自动设置一些参数的值(简化初级用户的数据库参数优化)。

参考

阿里云PPAS商用版本(兼容Oracle)

https://www.enterprisedb.com/docs/en/10.0/EPAS_Guide_v10/EDB_Postgres_Advanced_Server_Guide.1.25.html#pID0E0KQF0HA

Flag Counter

digoal’s 大量PostgreSQL文章入口