7 Administration bad practices

 

In this chapter

  • Letting disk usage get out of hand
  • Missing hints of danger by not looking at logs
  • Collecting and analyzing statistics
  • Upgrading is not optional

After all the exciting development and optimization topics we’ve discussed, when the time comes to take the database into production, the comparatively mundane task of administration may feel like a chore. However, how you administer the database is an integral part of PostgreSQL’s robustness and reliability. It determines the success of your Postgres deployment and can make or break critical systems. We’ll now look at some mistakes database administrators (DBAs) may make, either through lack of familiarity or inexperience, when managing Postgres.

7.1 Not tracking disk usage

It seems hard to believe, yet it’s still one of the top problems faced by people who support PostgreSQL installations. Inevitably, one day, someone will contact them requesting their help in solving the dreaded “No space left on device” error. This section could have been named “Running Out of Disk Space,” but instead, what I want to emphasize here and now is that if you aren’t tracking your disk space usage, you are taking a huge risk.

7.1.1 Deleting the Write-Ahead Log

7.1.2 What can eat up your disk space?

7.1.3 What can you do?

7.2 Logging to PGDATA

7.3 Ignoring the logs

7.3.1 Bad configuration

7.3.2 Performance issues

7.3.3 Locks

7.3.4 Corruption

7.3.5 Security

7.4 Not monitoring the database

7.5 No tracking of statistics over time

7.6 Not upgrading Postgres

7.7 Not upgrading your system

Summary