|
1 | 1 | --- |
2 | | -title: "Before and after tuning PostgreSQL" |
| 2 | +title: "Measure the impact of tuning PostgreSQL" |
| 3 | +description: Learn how to approach PostgreSQL performance tuning as a measurement-driven process and compare baseline results with tuned results. |
3 | 4 | weight: 2 |
4 | 5 | layout: "learningpathall" |
5 | 6 | --- |
6 | 7 |
|
7 | | -## About database performance tuning |
| 8 | +## About performance tuning |
8 | 9 |
|
9 | | -Deployment configurations and the profile of SQL requests made by clients will differ based on the use case. This means there is no one size fits all set of tuning parameters for `PostgreSQL`. Use the information in this learning path as guidance to help you tune `PostgreSQL` for your use case. Make sure to test any changes made to tuning parameters. |
| 10 | +Performance tuning is most useful when you treat it as a measurement process, not a fixed checklist. You can tune by changing one parameter at a time, running a designed experiment, comparing profiles, or using automation and AI-assisted tools to explore a larger configuration space. |
10 | 11 |
|
11 | | -## Importance of tuning |
| 12 | +There isn't a universal set of tuning parameters that works best for every PostgreSQL deployment. The right settings depend on the workload, data size, memory capacity, storage performance, network behavior, PostgreSQL version, system architecture, operating system, and other application-specific factors. |
12 | 13 |
|
13 | | -Application tuning allows you to gain performance without scaling your deployment up (bigger machines) or out (more machines). You have the option to use the gained performance or trade it for cost savings by reducing the total compute resources provisioned. Below is a graph that shows the difference performance tuning on `PostgreSQL` can make. |
| 14 | +Whatever method you use, keep the measurements repeatable. Record the system configuration, workload, software versions, and tuning parameters so you can identify which changes improved performance and which changes had little effect. |
14 | 15 |
|
15 | | - |
| 16 | +## Why tune PostgreSQL |
16 | 17 |
|
17 | | -Requirements vary based on the use case. In the example shown above, the AWS c7g.8xlarge instance could be down sized to a c7g.4xlarge to gain cost savings. |
| 18 | +PostgreSQL performance can be limited by memory use, storage I/O, connection handling, write-ahead logging, concurrency, or synchronization overhead. By tuning PostgreSQL, you can use the available compute, memory, and storage resources more efficiently. |
| 19 | + |
| 20 | +Improved performance can give you higher throughput, lower latency, or better cost efficiency. A tuned configuration can increase capacity on the same system or help you meet the same performance target with fewer compute resources. |
| 21 | + |
| 22 | +## Example benchmark result |
| 23 | + |
| 24 | +The following example shows PostgreSQL throughput with HammerDB TPROC-C before and after tuning on an Arm Neoverse V3 system. The throughput metric, NOPM, stands for New Orders Per Minute. The bars show normalized NOPM, with the out-of-box configuration set to `1.00`. |
| 25 | + |
| 26 | + |
| 27 | + |
| 28 | +This benchmark result is an example, not a guaranteed improvement for every workload. Your results depend on the PostgreSQL version, database size, storage device, memory capacity, client concurrency, and SQL statements used in the test. Record those details with your own results so you can interpret and reproduce the comparison. |
| 29 | + |
| 30 | +## What you've learned and what's next |
| 31 | + |
| 32 | +You've learned why PostgreSQL tuning benefits from a measurement-driven approach and reviewed an example of throughput improvement after tuning. |
| 33 | + |
| 34 | +Next, you'll examine the system-level settings that can affect PostgreSQL performance. |
0 commit comments