patternMinor
Stopping a running compaction process
Viewed 0 times
processrunningcompactionstopping
Problem
I need to run compaction on a production CouchDB instance, that may not have had compaction run on it before.
If compaction puts too much additional load on the CouchDB instance, is it possible to safely kill the compaction process? If so, how?
If compaction puts too much additional load on the CouchDB instance, is it possible to safely kill the compaction process? If so, how?
Solution
During compaction, a new .couch file is written. So what you would do, when you interrupt compaction is making the file useless. The only way to stop compaction (iirc) is to stop CouchDB. Not a good idea.
Generally, compaction is a background process. The database reads are not affected by it - also for heavy read! If you have heavy write processes, compaction may never end because writing and updating a doc is faster than compaction.
You could consider scheduling compaction to a time slot, where you know that the database is not on 100% capacity. You do that in
This means, run automatic compaction only during 2 and 5 in the night and only, when the fragmentation of the database is greater than or equals 70% and the view fragmentation is greater than or equals 60%
Further info can be found here: http://docs.couchdb.org/en/latest/maintenance/compaction.html
If you have questions you are very welcome to join the dev@couchdb.apache.org mailinglist or join IRC at #couchdb-dev or #couchdb at irc.freenode.net
Generally, compaction is a background process. The database reads are not affected by it - also for heavy read! If you have heavy write processes, compaction may never end because writing and updating a doc is faster than compaction.
You could consider scheduling compaction to a time slot, where you know that the database is not on 100% capacity. You do that in
local.ini like this:; configuration for automatic compaction.
; see: http://docs.couchdb.org/en/latest/config/compaction.html
[compactions]
_default = [{db_fragmentation, "70%"}, {view_fragmentation, "60%"}, {from, "02:00"}, {to, "05:00"}]This means, run automatic compaction only during 2 and 5 in the night and only, when the fragmentation of the database is greater than or equals 70% and the view fragmentation is greater than or equals 60%
Further info can be found here: http://docs.couchdb.org/en/latest/maintenance/compaction.html
If you have questions you are very welcome to join the dev@couchdb.apache.org mailinglist or join IRC at #couchdb-dev or #couchdb at irc.freenode.net
Code Snippets
; configuration for automatic compaction.
; see: http://docs.couchdb.org/en/latest/config/compaction.html
[compactions]
_default = [{db_fragmentation, "70%"}, {view_fragmentation, "60%"}, {from, "02:00"}, {to, "05:00"}]Context
StackExchange Database Administrators Q#114981, answer score: 4
Revisions (0)
No revisions yet.