CouchDB .view file growing out of control?

后端 未结 4 864
天命终不由人
天命终不由人 2021-02-02 01:51

I recently encountered a situation where my CouchDB instance used all available disk space on a 20GB VM instance. Upon investigation I discovered that a directory in /usr/local/

4条回答
  •  悲&欢浪女
    2021-02-02 02:20

    I've had this problem too, trying out CouchDB for a browsed-based game.

    We had about 100.000 unexpected visitors on the first day of a site launch, and within 2 days the CouchDB database was taking about 40GB in space. This made the server crash because the HD was completely full.

    Compaction brought that back to about 50MB. I also set the _revs_limit (which defaults to 1000) to 10 since we didn't care about revision history, and it's running perfectly since. After almost 1M users, the database size is usually about 2-3GB. When i run compaction it's about 500MB.

    Setting document revision limit to 10:
    curl -X PUT -d "10" http://dbuser:dbpassword@127.0.0.1:5984/yourdb/_revs_limit

    Or without user:password (not recommended):
    curl -X PUT -d "10" http://127.0.0.1:5984/yourdb/_revs_limit

提交回复
热议问题