Data-driven PostgreSQL performance tuning
PostgreSQL is a powerful enterprise class database, serving companies like Skype, Instagram or Etsy.com. However, with today's growing enterprise data PostgreSQL performance can suffer. By keeping an eye on the overall database health and proactively looking for potential problems you can resolve them before they have a chance to affect the user experience.
By following this database performance checklist you can easily find issues and optimize your PostgreSQL database accordingly:
- Verify your hosts’ health by looking at server data
- Ensure that your virtualization works fine by analyzing virtual machine metrics
- Optimize database access with application data
- Analyze the network impact of database communication with network data
Server data tells about your hosts’ health
By checking CPU, memory, and disk space metrics you make sure your PostgreSQL processes have sufficient resources available.
CPU - PostgreSQL databases will deliver better performance on faster CPUs. When monitoring virtual machines, also monitor the virtual host that the machines run on. Numbers like CPU ready time are of particular importance.
Page faults per seconds - Having thousands of page faults per second indicates that your hosts are out of memory.
Disk space - For an optimal PostgreSQL performance make sure you have lots of disk space available on your hard drive.
Know which commands affect database performance
Knowing which services access your PostgreSQL DB is vital for finding performance bottlenecks. If there is a single service that’s suffering from bad database response times, dig deeper into that service’s metrics to find out what’s causing the problem.
Take a deeper look into the service’s communication with the database and find our what kind of commands affect the database performance the most.
Verify your app’s database connection
Even if the way you query your database is perfectly fine, you may still experience inferior database performance. Make sure if your application’s database connection is correctly sized.
Keep an eye on network metrics
If a database performance issue suddenly appears, process level visibility comes in handy in identifying a failing component.
Tuning your PostgreSQL database performance with Dynatrace
Dynatrace monitors and analyzes the activity of your PostgreSQL databases' performance across all platforms, providing visibility down to individual database statements.
- Auto-detect your PostgreSQL databases
- Visualize how apps use your database
- See detailed metrics for every single database statement
- Directly relate PostgreSQL performance metrics to queries