- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我在 Ubuntu 上运行 PostgreSQL 9.2。 autovacuum 进程正在服务器上运行。
数据库负载很重,每天有 1000 次添加和 100 次删除,但似乎 autovacuum 没有启动。
日志中没有任何与 vacuum 相关的内容。
执行 ps -ef | grep -i 真空
产生:postgres 1406 1130 0 Oct13 00:00:14 postgres: autovacuum launcher process
运行查询 SELECT last_autovacuum , last_autoanalyze FROM pg_stat_user_tables;
在最后一个 autovacuum 列中不产生任何记录,在 suto_analyze 列中产生 2 个条目。
postgresql.conf 的相关部分是:
#------------------------------------------------------------------------------
# AUTOVACUUM PARAMETERS
#------------------------------------------------------------------------------
autovacuum = on # Enable autovacuum subprocess? 'on'
# requires track_counts to also be on.
log_autovacuum_min_duration = 250 # -1 disables, 0 logs all actions and
# their durations, > 0 logs only
# actions running at least this number
# of milliseconds.
autovacuum_max_workers = 3 # max number of autovacuum subprocesses
# (change requires restart)
#autovacuum_naptime = 1min # time between autovacuum runs
autovacuum_vacuum_threshold = 128 # min number of row updates before
# vacuum
autovacuum_analyze_threshold = 128 # min number of row updates before
# analyze
#autovacuum_vacuum_scale_factor = 0.2 # fraction of table size before vacuum
#autovacuum_analyze_scale_factor = 0.1 # fraction of table size before analyze
#autovacuum_freeze_max_age = 200000000 # maximum XID age before forced vacuum
# (change requires restart)
#autovacuum_vacuum_cost_delay = 20ms # default vacuum cost delay for
# autovacuum, in milliseconds;
# -1 means use vacuum_cost_delay
#autovacuum_vacuum_cost_limit = -1 # default vacuum cost limit for
# autovacuum, -1 means use
# vacuum_cost_limit
有什么想法吗?
最佳答案
引用配置中的相关条目大概是:
autovacuum_vacuum_scale_factor = 0.2
使用此默认值,如果删除或更新的行少于 20%(或少于 autovacuum_vacuum_threshold
行,但在 128 时,autovacuum 跳过该表是正常的,这在这里无关紧要) .
请参阅 documentation 中的定义:
autovacuum_vacuum_scale_factor (floating point)
Specifies a fraction of the table size to add to autovacuum_vacuum_threshold when deciding whether to trigger a VACUUM. The default is 0.2 (20% of table size). This parameter can only be set in the postgresql.conf file or on the server command line. This setting can be overridden for individual tables by changing storage parameters.
如果您不喜欢默认值,要让 autovacuum 处理某些表,您可以根据具体情况降低此参数。例如将其设置为 1%:
ALTER TABLE tablename SET (autovacuum_vacuum_scale_factor=0.01);
关于database - 尽管进程正在运行,但 postgresql autovacuum 不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19527571/
我们的 Postgres 数据库(托管在具有 1 个 CPU、3.7 GB RAM 的 Google Cloud SQL 上,见下文)主要由一个大约 90GB 的大表组成,大约有大约 6000 万行。
关闭。这个问题是off-topic .它目前不接受答案。 想改进这个问题吗? Update the question所以它是on-topic用于堆栈溢出。 关闭 10 年前。 社区在 6 个月前 审
如何在 PostgreSQL 中启用 autovacuum?我了解目的,只是找不到有关如何启用它的简单答案。 最佳答案 Autovacuum 默认是开启的。对于小型数据库什么都不做,一切都会正常工作。
有谁知道 autovacuum 在数据库的意义上意味着什么? 最佳答案 特定于 PostgreSQL这意味着: PostgreSQL's VACUUM command has to run on a
我们有一个非常大的表,被划分为每月表。我们没有在 postgresql.conf 文件中设置 autovacuum 参数,因此默认情况下使用默认参数。 过去几个月的表table_201404、tabl
我有几个关于 autovacuum 的问题: 在加载/更新数据或大查询的漫长过程之前关闭清理是否安全? autovacuum 的推荐配置是什么? 最佳答案 广告 1:是的,它是安全的,但您需要重新启动
我有一个非常大的表,有 400MM 条记录,通常只接收插入。但是,最近我必须对记录进行大量更新才能完成任务。这会产生很多死元组。我已将全局配置更新为以下内容: autovacuum_vacuum_sc
“autovacuum_naptime”和“autovacuum_vacuum_cost_delay”有什么区别? “autovacuum launcher 进程”和“autovacuum worke
我们有一个产品日志数据库,它只产生insert sql。但是我们发现autovacuum 进程占用了如此多的内存。它在峰值时需要大约 16 GB,而且它是大约每2个月发生一次。以下是详细信息,有人知道
我将我的 9.4 postgresql 集群升级到了 9.6。 (通过 pg_upgrade,所以我的数据库统计数据没有移动到新集群)我有一张大 table (大约 450M 条记录)。这个表在我的代
我只是在经历一种情况,在这种情况下我根本没有得到我的问题的线索。 我有一个名为 names 的表(包含名称和时间列)。该表每分钟插入大量行。并且这些插入的记录将在特定时间间隔被删除。所以,最后我停止插
我有一个关于 Postgres 自动真空/真空设置的问题。 我有一个包含 45 亿行的表,有一段时间进行了大量更新,导致大约 15 亿个死元组。此时 autovacuum 需要很长时间(几天)才能完成
我使用的是 Postgresql 9.3。 我有一个巨大的 pg_toast 表,pg_toast_675632,占用了 27 GB。 除非我误解了,否则这个 pg_toast_675632 是如此之
我们在Centos 操作系统上使用postgres 9.2 版本。我们有大约 1300 多张 table 。我们启用了以下自动真空设置。仍然很少有总是很忙的表(84 个表)没有被清理。这些表中的死元组
我正在尝试在 Postgres 9.1 实例上重新启用 autovacuuming 并在数据库日志中收到: 2013-07-07 14:47:12 CDT WARNING: autovacuum n
我的模式中有一个表没有自动清理。如果我在表上运行 VACUUM posts;,清理过程会很好地完成,但是 autovacuum 守护进程出于某种原因永远不会对表进行清理。有没有办法找出原因?这可能是什
我有大表,其中我只有插入和选择,所以当这个表的 autovacuum 运行时 - 系统非常慢。我已关闭特定表的 autovacuum: ALTER TABLE ag_event_20141004_20
我是 PostgreSQL(9.2 版)数据库开发的新手。在查看我的一张 table 时,他看到了一个名为 autovaccum 的选项。 我的许多表都包含 20000 多行。出于测试目的,我已经更改
我正在研究这个 Heroku tutorial我有一个关于 autovacuum 的问题过程。仍然没有表格或数据,autovacuum 启动器现在已挂起半个多小时。下面是cmd window 。 我找
我有一个在 pg_toast 上运行的 autovacuum 进程: select query, from pg_stat_activity where query like '%autov%'; "
我是一名优秀的程序员,十分优秀!