-
Notifications
You must be signed in to change notification settings - Fork 0
CouchDB Setup
CouchDB has several items that need to be setup.
TODO: add users, replication plan, etc.
##Binding
bind_address = 0.0.0.0
The private couch instance should be bound to the internal network only.
bind_address = 192.160.?.?
CORS support is a bit strange, but here are the basic settings that have been testing:
enable_cors = true
origins = *
credentials = true
Note entirely sure why the credentials = true
setting is necessary, but it is! Even with this on, the system throws errors, however.
The following settings have not been tested! By default, CouchDB stores 1,000 revisions of a record. This is insane because the overhead required increase with each revisions:
Revisions | Size Per | Totals (simple) |
---|---|---|
1 | 4 | 4KB |
180 | 8 | 8MB |
230 | 12 | 12MB |
300 | 16 | 16MB |
400 | 20 | 20MB |
880 | 40 | 40MB |
1000 | 44 | 44MB |
This can be fixed by changing default the compaction and revisions settings. ##Compaction
If the ratio (as an integer percentage), of the amount of old data (and its supporting metadata) over the database file size is equal to or greater then this value, this database compaction condition is satisfied. This value is computed as:
(file_size - data_size) / file_size * 100
By default this is 70% but a freshly compacted speech and Namecoin database runs at 10% or 20%. Obviously, this may blow up if we set the revision number too low and so need to test any new settings first.
##Revisions Not entirely sure of the appropriate number. It's currently set to 2 but there are some warnings regarding replications. Set command:
curl -X PUT -d "10" http://localhost:5984/test/_revs_limit
#=> {"ok":true}
curl -X GET http://localhost:5984/test/_revs_limit
#=> 10
You would think setting this number to 2 would be enough, but the databases keep blowing up to 10x their post-compaction size : (