To benchmark Couchbase performance in a non-blocking web server.
1.4K
This repository is to run benchmark with Couchbase servers.
The benchmark tool works with Couchbase server 6.5 to 7.2. Other versions of Couchbase server are not tested.
Run following command to benchmark with a specific Couchbase server:
docker run --rm \
-e COUCHBASE_HOST= \
-e COUCHBASE_USER= \
-e COUCHBASE_PASS= \
-e COUCHBASE_BUCKET= \
-ti deminy/couchbase-benchmark
You need to update Docker environment variable COUCHBASE_HOST, COUCHBASE_USER, COUCHBASE_PASS, and COUCHBASE_BUCKET first before running above command.
Assuming that we have a Couchbase certificate file ./couchbase.pem and we want to use it to run benchmarks:
docker run --rm \
-v "$(pwd)/couchbase.pem:/couchbase.pem" \
-e COUCHBASE_HOST= \
-e COUCHBASE_USER= \
-e COUCHBASE_PASS= \
-e COUCHBASE_BUCKET= \
-e COUCHBASE_OPTIONS="truststorepath=/couchbase.pem&wait_for_config=true" \
-ti deminy/couchbase-benchmark
# or, if we don't want to validate the SSL certificate while benchmarking. This should be used for debugging purposes only.
docker run --rm \
-v "$(pwd)/couchbase.pem:/couchbase.pem" \
-e COUCHBASE_HOST= \
-e COUCHBASE_USER= \
-e COUCHBASE_PASS= \
-e COUCHBASE_BUCKET= \
-e COUCHBASE_OPTIONS="truststorepath=/couchbase.pem&ssl=no_verify&wait_for_config=true" \
-ti deminy/couchbase-benchmark
# Coding style fixes.
docker run --rm -v "$(pwd):/var/www" -w /var/www -i jakzal/phpqa:php8.1 php-cs-fixer fix
# To build the Docker image. We build AMR64 images only because there is no download link for ARM64.
docker build --platform linux/amd64 --build-arg PHP_VERSION=8.0 -t deminy/couchbase-benchmark .
# To read the manual of command "ab".
docker run --rm --entrypoint "/bin/sh" -ti deminy/couchbase-benchmark -c "ab -h"
# To install PHP packages.
docker run --rm -v "$(pwd):/var/www" --entrypoint "/bin/sh" -ti deminy/couchbase-benchmark -c "composer install -n"
If you want to test the benchmark script locally, you can start a Couchbase container first, then use it to run the benchmark script, like following:
# Start a Couchbase container.
docker run --rm -d --name couchbase -e CB_ADMIN=username -e CB_ADMIN_PASSWORD=password -e CB_BUCKET=test -t deminy/couchbase:7.2.2
# Run a benchmark with the Couchbase container.
docker run --rm --platform=linux/amd64 \
-e COUCHBASE_HOST=$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' couchbase) \
-ti deminy/couchbase-benchmark
# Stop the Couchbase container.
docker stop couchbase
Content type
Image
Digest
sha256:b7d80827d…
Size
230.7 MB
Last updated
about 1 year ago
docker pull deminy/couchbase-benchmark