如何判断PostgreSQL的Autovacuum是否在UNIX上运行? [英] How can I tell if PostgreSQL's Autovacuum is running on UNIX?

查看:265
本文介绍了如何判断PostgreSQL的Autovacuum是否在UNIX上运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何判断Postgres 9.x中的 autovacuum守护程序是否正在运行并维护数据库集群?

How can one tell if the autovacuum daemon in Postgres 9.x is running and maintaining the database cluster?

推荐答案

PostgreSQL 9.3



确定Autovacuum是否正在运行



这特定于Postgres 9.3 on UNIX。
对于Windows,请参见此问题

SELECT
  schemaname, relname,
  last_vacuum, last_autovacuum,
  vacuum_count, autovacuum_count  -- not available on 9.0 and earlier
FROM pg_stat_user_tables;



Grep系统进程状态



Grep System Process Status

$ ps -axww | grep autovacuum
24352 ??  Ss      1:05.33 postgres: autovacuum launcher process  (postgres)    



Grep Postgres Log



Grep Postgres Log

# grep autovacuum /var/log/postgresql
LOG:  autovacuum launcher started
LOG:  autovacuum launcher shutting down

如果您想进一步了解 autovacuum 活动,请设置 log_min_messages DEBUG1..DEBUG5 。 SQL命令 VACUUM VERBOSE 将以日志级别 INFO 输出信息。

If you want to know more about the autovacuum activity, set log_min_messages to DEBUG1..DEBUG5. The SQL command VACUUM VERBOSE will output information at log level INFO.

关于Autovacuum守护程序,Posgres文档声明:

Regarding the Autovacuum Daemon, the Posgres docs state:


配置,将启用自动清理并适当设置相关的配置参数。

In the default configuration, autovacuuming is enabled and the related configuration parameters are appropriately set.

另请参见:

  • http://www.postgresql.org/docs/current/static/routine-vacuuming.html
  • http://www.postgresql.org/docs/current/static/runtime-config-autovacuum.html

这篇关于如何判断PostgreSQL的Autovacuum是否在UNIX上运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆