Home

Awesome

Watermill Benchmark

<img align="right" width="200" src="https://threedots.tech/watermill-io/watermill-logo.png">

This is an early set of tools for benchmarking watermill.

Warning: This tool is meant to provide a rough estimate on how fast each Pub/Sub can process messages. It uses very simplified infrastructure to set things up and default configurations.

Keep in mind that final performance depends on multiple factors.

How it works

Results

This is an early version of benchmark results. Expect it to be updated and grow.

Kafka (one node)

Message size (bytes)Publish (messages / s)Subscribe (messages / s)
1644,090108.285
6441,371108,848
25641,497111,756

NATS Jetstream (16 Subscribers)

Message size (bytes)Publish (messages / s)Subscribe (messages / s)Subscribe (messages / s - async ack)
1649,25533,00963,065
6449,29633,01662,667
25648.48832,57362,745

NATS Jetstream (48 Subscribers)

Message size (bytes)Publish (messages / s)Subscribe (messages / s)Subscribe (messages / s - async ack)
1648,88245,27590,917
6448,68144,74689,527
25648,09744,48790,510

Redis

Message size (bytes)Publish (messages / s)Subscribe (messages / s)
1661,64211,213
6458,55411,252
25658,90611,408

SQL (MySQL)

Message size (bytes)Publish (messages / s)Subscribe (messages / s)
165,599167
645,625168
2565,381164

SQL (PostgreSQL)

Message size (bytes)Publish (messages / s)Subscribe (messages / s)
163,834455
643,923468
2563,855472

Google Cloud Pub/Sub (16 subscribers)

Message size (bytes)Publish (messages / s)Subscribe (messages / s)
163,68930,229
643,40826,448
2566,96730,123

AMQP (RabbitMQ, 16 subscribers)

Message size (bytes)Publish (messages / s)Subscribe (messages / s)
162,70213,192
642,71212,980
2562,6928,027

GoChannel

Message size (bytes)Publish (messages / s)Subscribe (messages / s)
16331,882118,943
64298,847123,499
256373,053130,940

VM Setup

The project includes Terraform definition for setting up an instance on Google Cloud Platform.

It will spin up a fresh Ubuntu 19.04 instance, install docker with dependencies and clone this repository.

Set environment variables:

# path to GCP credentials file
TF_VAR_credentials_path=
# project name on GCP
TF_VAR_project=
# public part of the key that you will use to access SSH
TF_VAR_pub_key_path=

Create the VM:

cd setup
terraform apply

The command will output the public IP address of the server. Use ssh with user benchmark to access it.

After running all benchmarks, destroy the VM:

terraform destroy

Configuration

Google Pub/Sub

Set environment variables in compose/.env:

# path to json file within the project with GCP credentials
GOOGLE_APPLICATION_CREDENTIALS=compose/key.json
# project name on GCP
GOOGLE_CLOUD_PROJECT=

Running

Run benchmarks with:

./run.sh <pubsub>