Performance Analysis and Tuning v11
Advanced Server provides various tools for performance analysis and tuning. These features are described in this section.
Dynatune
Advanced Server supports dynamic tuning of the database server to make the optimal usage of the system resources available on the host machine on which it is installed. The two parameters that control this functionality are located in the postgresql.conf
file. These parameters are:
edb_dynatune
edb_dynatune_profile
edb_dynatune
edb_dynatune
determines how much of the host system's resources are to be used by the database server based upon the host machine's total available resources and the intended usage of the host machine.
When Advanced Server is initially installed, the edb_dynatune
parameter is set in accordance with the selected usage of the host machine on which it was installed - i.e., development machine, mixed use machine, or dedicated server. For most purposes, there is no need for the database administrator to adjust the various configuration parameters in the postgresql.conf
file in order to improve performance.
You can change the value of the edb_dynatune
parameter after the initial installation of Advanced Server by editing the postgresql.conf
file. The postmaster must be restarted in order for the new configuration to take effect.
The edb_dynatune
parameter can be set to any integer value between 0
and 100
, inclusive. A value of 0
, turns off the dynamic tuning feature thereby leaving the database server resource usage totally under the control of the other configuration parameters in the postgresql.conf
file.
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.
Once a value of edb_dynatune
is selected, database server performance can be further fine-tuned by adjusting the other configuration parameters in the postgresql.conf
file. Any adjusted setting overrides the corresponding value chosen by edb_dynatune
. You can change the value of a parameter by un-commenting the configuration parameter, specifying the desired value, and restarting the database server.
edb_dynatune_profile
The edb_dynatune_profile
parameter is used to control tuning aspects based upon the expected workload profile on the database server. This parameter takes effect upon startup of the database server.
The possible values for edb_dynatune_profile
are:
Value | Usage |
---|---|
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 Wait States
The EDB wait states contrib module contains two main components.
EDB Wait States Background Worker (EWSBW)
When the wait states background worker is registered as one of the shared preload libraries, EWSBW probes each of the running sessions at regular intervals.
For every session it collects information such as the database to which it is connected, the logged in user of the session, the query running in that session, and the wait events on which it is waiting.
This information is saved in a set of files in a user-configurable path and directory folder given by the edb_wait_states.directory
parameter to be added to the postgresql.conf
file. The specified path must be a full, absolute path and not a relative path.
The following describes the installation process on a Linux system.
Step 1: EDB wait states is installed with the edb-asxx-server-edb_wait_states
RPM package where xx
is the Advanced Server version number.
Step 2: To launch the worker, it must be registered in the postgresql.conf
file using the shared_preload_libraries
parameter, for example:
Step 3: Restart the database server. After a successful restart, the background worker begins collecting data.
Step 4: To review the data, create the following extension:
Step 5: To terminate the EDB wait states worker, remove $libdir/edb_wait_states
from the shared_preload_libraries
parameter and restart the database server.
The following describes the installation process on a Windows system.
Step 1: EDB wait states module is installed with the EDB Modules
installer by invoking StackBuilder Plus utility. Follow the onscreen instructions to complete the installation of the EDB Modules
.
Step 2: To register the worker, modify the postgresql.conf
file to include the wait states library in the shared_preload_libraries
configuration parameter. The parameter value must include:
The EDB wait states installation places the edb_wait_states.dll
library file in the following path: