TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Postgres Autovacuum is Not the Enemy

77 pointsby narfzover 8 years ago

6 comments

bradknowlesover 8 years ago
The actual title of the article is "Postgres Autovacuum is Not the Enemy". The word "Postgres" is a critical element here and should not be left off.
评论 #12878978 未加载
hyuenover 8 years ago
The main problem here is that autovacuum threshold is something like c + m * nrows, and in large configurations you could have all sorts of table sizes.<p>How much change is a lot? 1% of the table + 50 rows (for small tables)? I would argue that sometimes is better to use a fixed threshold, e.g. c = 1000, m=0<p>All these approaches are hit or miss and are different per configuration. What I found useful is to choose the best parameters you can think of without forcing autovacuum to run everytime, and have an external job run vacuum manually to cleanup whatever got missed... eventually you can figure out the right configuration.
评论 #12878353 未加载
评论 #12880795 未加载
pgaddictover 8 years ago
I find the recommendation to leave the cost limit alone strange. The problem is this is a global limit, shared by all autovacuum workers. The default (200) means all workers combined should not do more than 8 MB&#x2F;s reads or 4 MB&#x2F;s writes, which on current hardware are rather low limits. Increasing the number of workers is good, but the total autovacuum throughput does not change - there will be more workers but they&#x27;ll go slower.<p>Also a note regarding the delay - the resolution really depends on hardware. Some timers have only 10ms resolution, for example.
评论 #12881185 未加载
JulianWasTakenover 8 years ago
Unreadable in portrait on mobile?<p>How does one even begin to think that blocking users from scrolling horizontally on your site is a good idea?
评论 #12879735 未加载
评论 #12880881 未加载
AznHisokaover 8 years ago
What ive found is that if wih the default settings, if you&#x27;re running over 150 million inserts&#x2F;updates&#x2F;deletes a day, your database is going to halt because of transaction wraparound errors. autovacuum simply cant catch up.<p>the solution for me was to batch inserts and updates in one transaction.
ckdarbyover 8 years ago
Site text gets cut off on mobile