have an instance of Bitnami CouchDB on google
noticed very high CPU usage and found logrotate running at 100% CPU
(came back from holiday to find this instance had been running 100% for 5 days!)
killed it and investigated found 1,003,996 files (195M) in /opt/bitnami/couchdb/var/log/couchdb/
looks like the logrotate is creating muttiple gzips of the logs
e.g.
-rw-r–r-- 1 root root 0 Jan 10 22:12 couchdb.stderr-20160911.gz-20160918.gz-20161016.gz-20161023.gz-20161030.gz-20161106.gz-20161204.gz-20161211.gz
-rw-r–r-- 1 root root 0 Jan 10 22:12 couchdb.stderr-20160911.gz-20160918.gz-20161016.gz-20161023.gz-20161030.gz-20161106.gz-20161204.gz-20161211.gz-20161218.gz
-rw-r–r-- 1 root root 0 Jan 10 22:12 couchdb.stderr-20160911.gz-20160918.gz-20161016.gz-20161023.gz-20161030.gz-20161106.gz-20161204.gz-20161211.gz-20161218.gz-20161225.gz
-rw-r–r-- 1 root root 0 Jan 10 22:12 couchdb.stderr-20160911.gz-20160918.gz-20161016.gz-20161023.gz-20161030.gz-20161106.gz-20161204.gz-20161211.gz-20161218.gz-20161225.gz-20170101.gz
-rw-r–r-- 1 root root 117 Nov 28 06:30 couchdb.stderr-20160911.gz-20160918.gz-20161016.gz-20161023.gz-20161030.gz-20161106.gz-20161204.gz-20161211.gz-20161218.gz-20161225.gz-20170101.gz-20170108.gz
-rw-r–r-- 1 root root 20 Jan 8 10:08 couchdb.stderr-20160911.gz-20160918.gz-20161016.gz-20161023.gz-20161030.gz-20161106.gz-20161204.gz-20161211.gz-20161218.gz-20161225.gz-20170101.gz-20170109.gz
-rw-r–r-- 1 root root 20 Jan 9 16:36 couchdb.stderr-20160911.gz-20160918.gz-20161016.gz-20161023.gz-20161030.gz-20161106.gz-20161204.gz-20161211.gz-20161218.gz-20161225.gz-20170101.gz-20170110.gz
so I killed logrotate
sudo killall logrotate
deleted all the couchdb.stderr gz files
sudo nice -n12 find /opt/bitnami/couchdb/var/log/couchdb -name couchdb.stderr-*.gz -delete
ran logrotate again
/usr/sbin/logrotate -vdf /etc/logrotate.conf
all good
but need some help on what to do to stop this reoccuring ?
thanks pb…