- From: Joshua Miller <
>
- To:
- Subject: [chef] Re: couchdb is huge
- Date: Wed, 8 Sep 2010 10:41:35 -0700
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; b=srMF0blReEruoS2huu/W8CXcv0ngzuqxcFJgFToDDTXcAQP0uON9kYJubeYluo7CzM AMLIw9PzW6wnPoVRXuO0EcAQsInWgkIwEX2RE0SkMkeRMmRpmndcpw0o46UPGjlttIOM AOVunxxXN50gCEwqyHQNWu4TIMn7H4AhmjOGo=
sounds like your not running the chef server recipe as it compacts the db for
your. If there is a reason your not running it the easies way is to create a
new recipe with these lines in it and run on the server, otherwise you can
curl a url like
http://wiki.apache.org/couchdb/Compaction
example:
:~$
curl -H "Content-Type: application/json" -X POST
http://localhost:5984/chef/_compact
{"ok":true}
:~$
# code for compact in recipe from chef-server recipe
http_request "compact chef couchDB" do
action :post
url "#{Chef::Config[:couchdb_url]}/chef/_compact"
only_if do
begin
open("#{Chef::Config[:couchdb_url]}/chef")
JSON::parse(open("#{Chef::Config[:couchdb_url]}/chef").read)["disk_size"] >
100_000_000
rescue OpenURI::HTTPError
nil
end
end
end
%w(nodes roles registrations clients data_bags data_bag_items users).each do
|view|
http_request "compact chef couchDB view #{view}" do
action :post
url "#{Chef::Config[:couchdb_url]}/chef/_compact/#{view}"
only_if do
begin
open("#{Chef::Config[:couchdb_url]}/chef/_design/#{view}/_info")
JSON::parse(open("#{Chef::Config[:couchdb_url]}/chef/_design/#{view}/_info").read)["view_index"]["disk_size"]
>
100_000_000
rescue OpenURI::HTTPError
nil
end
end
end
end
On Sep 8, 2010, at 10:19 AM, Gilles Devaux wrote:
>
Hi,
>
>
The couchdb instance on chef-server is getting huge. I have to restart
>
it sometimes because its memory footprint keeps growing but the file
>
itself is becoming humongous:
>
>
couchdb]$ ll -h
>
total 90G
>
-rw-r--r-- 1 couchdb couchdb 90G Sep 8 17:18 chef.couch
>
-rw-r--r-- 1 couchdb couchdb 3.7K Sep 8 17:18 couchdb.stderr
>
-rw-r--r-- 1 couchdb couchdb 9.7K Sep 8 17:18 couchdb.stdout
>
>
I don't have an exceptional setup, all opscode cookbooks + 15 of my
>
own, one of them contains a 35Mo file (yes I know, not ideal, I chose
>
the easy way). Still far from 90Go.
>
>
Any clue?
>
>
--Gilles
Archive powered by MHonArc 2.6.16.