Skip to main content

BgWorkerShutdown

Short Description

Waiting for background worker to shut down.

Additional Information​

A background worker (BGW) is a user-defined process which runs as part of the main postgres server process. PostgreSQL can be extended to run user-supplied code in separate processes. Such processes are started, stopped and monitored by postgres, which permits them to have a lifetime closely linked to the server's status. In this case we are waiting for a background worker process to shut down.

How to reduce this wait​

Background workers are used by the RDBMS in parallel queries, logical replication and autovacuum tasks.

  • If enabled, check to that replication is working properly. (see the pg_stat_replication view)
  • Check to see if parallel queries are running correctly.
  • Check autovacuum status

PostgreSQL documentation - Background Worker Processes

PostgreSQL documentation - The Statistics Collector

PostgreSQL documentation - Logical Replication

PostgreSQL documentation - Chapter 15. Parallel Query

PostgreSQL documentation - Progress Reporting (vacuum)

Search online​

If this article doesn't have the information you need you can try searching online. Remember, you can contribute suggestions to this page.