Launch Couchdb containers

Deploy couchdb 2.0 using PX volume; create a simple PX volume couch_vol01

docker run --name couchdb-001 -d \
        -v couch_vol01:/opt/couchdb/data \
        -p 5984:5984         \
        -p 4369:4369         \
        -p 9100:9100         \

Couchdb Web API use tcp port 5984 and couchdb app runs on port 5986. Most of the couchdb operation involves REAT API port 5984 and couchdb cluster setup use port 5986. The docker image rluiarch/couchdb2:001 is build from official couchdb 2.0 Docker file on github.

In Couchdb 2.0; four system databases ( “_users”, “_replicator”, “_metadata”, “_global_changes” ) wasn’t created by default and errors will be observed from docker logs; therefore these database need to be created after the couchdb container is up and running

curl -X PUT
curl -X PUT
curl -X PUT
curl -X PUT

Set up the admin user id/password; the default admin id is “admin” ; get into the couchdb docker container and use couchdb REAT API to add the admin user

 docker exec -it  couchdb-container-name bash
 curl -X PUT http://admin:[email protected]:5986/_config/admins/admin -d '"password"'

you can also create or change the admin ID / password from webUI

Change CouchDB credentials

Creating test database

Create three test couchdb database for testing purpose

curl -X PUT http://admin:[email protected]:5984/testdb101
curl -X PUT http://admin:[email protected]:5984/testdb102
curl -X PUT http://admin:[email protected]:5984/testdb103

Use the testscript to inject documents into those test databases. The test script will insert 1000 X 500 bytes documents into the target couchdb database.

And script will run parallel multiple of the above script processes. Below the example will run 100,200, and 300 jobs of 1000 document insertion into the target database testdb101, testdb102, and testdb103.

./ 100 testdb101 
./ 200 testdb102
./ 300 testdb103

The following is the performance test result for PX (single volume repl=1, locally attached, remotely attached) vs Standard local disk in ext4 (baseline) on Couchdb 2.0 (no couchdb replication and sharding).

Test results