You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by John Merrells <jo...@merrells.com> on 2010/04/24 19:05:37 UTC

last compact time || updates since last compact

Hello

I'm writing a script to automate compaction of my couch databases. Right now it just calls compact on all the databases it finds on each server, which turns out to be a bit wasteful if the database hasn't changed much since the last compaction. I could grab the info for each database and stash it for later, but it'd be handier if couch just exported status information for this. Does it? Could it? What do other folks do about automatic lazy couch compaction.... 

John

-- 
John Merrells
http://johnmerrells.com
+1.415.244.5808







Re: last compact time || updates since last compact

Posted by John Merrells <jo...@merrells.com>.
On Apr 24, 2010, at 10:12 AM, Nils Breunese wrote:

> How much should a database change before you'd want to compact it?

Good question.... the edge case is easy though... zero changes means that the compaction is pointless.

Since my email I've noticed that compacting a compacted database does seem to be pretty quick for a db of ~20mb. Maybe a second or two.

I think my query here was more driven by the fact that my script kept bombing out from a 500 coming back from the server and it was restarting and doing rework which was just boring for me to watch.

> In what way would you measure that

info returns update_seq which could be used to determine the number of updates (i assume).... also info returns the total database file size and the number of documents so you can work out the average bytes per document.... for which there could be a threshold over which compaction is clearly required.

John

-- 
John Merrells
http://johnmerrells.com
+1.415.244.5808







RE: last compact time || updates since last compact

Posted by Nils Breunese <N....@vpro.nl>.
How much should a database change before you'd want to compact it? In what way would you measure that? I just run a daily Python script (using couchdbkit) that compacts all databases and views, which works fine in our setup. I think I heard upcoming versions of CouchDB will support some form of auto-compacting?

Nils Breunese.
________________________________________
Van: John Merrells [john@merrells.com]
Verzonden: zaterdag 24 april 2010 19:05
Aan: user@couchdb.apache.org
Onderwerp: last compact time || updates since last compact

Hello

I'm writing a script to automate compaction of my couch databases. Right now it just calls compact on all the databases it finds on each server, which turns out to be a bit wasteful if the database hasn't changed much since the last compaction. I could grab the info for each database and stash it for later, but it'd be handier if couch just exported status information for this. Does it? Could it? What do other folks do about automatic lazy couch compaction....

John

--
John Merrells
http://johnmerrells.com
+1.415.244.5808







De informatie vervat in deze  e-mail en meegezonden bijlagen is uitsluitend bedoeld voor gebruik door de geadresseerde en kan vertrouwelijke informatie bevatten. Openbaarmaking, vermenigvuldiging, verspreiding en/of verstrekking van deze informatie aan derden is voorbehouden aan geadresseerde. De VPRO staat niet in voor de juiste en volledige overbrenging van de inhoud van een verzonden e-mail, noch voor tijdige ontvangst daarvan.