Skip to content

Commit f39eac5

Browse files
authored
chore: add benchmarks for a small cloud instance (#1264)
chore: add benchmarks showing single-threded performanc In addition addressed some questions raised during HN discussions. Signed-off-by: Roman Gershman <roman@dragonflydb.io>
1 parent 24b1343 commit f39eac5

File tree

2 files changed

+81
-10
lines changed

2 files changed

+81
-10
lines changed

README.md

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,50 @@ Fully compatible with Redis and Memcached APIs, Dragonfly requires no code chang
2828

2929
## <a name="benchmarks"><a/>Benchmarks
3030

31+
We first compare Dragonfly with Redis on `m5.large` instance which is commonly used to run Redis
32+
due to its single-threaded architecture. The benchmark program runs from another
33+
load-test instance (c5n) in the same AZ using `memtier_benchmark -c 20 --test-time 100 -t 4 -d 256 --distinct-client-seed`
34+
35+
Dragonfly shows a comparable performance:
36+
37+
1. SETs (`--ratio 1:0`):
38+
39+
| Redis | DF |
40+
| -----------------------------------------|----------------------------------------|
41+
| QPS: 159K, P99.9: 1.16ms, P99: 0.82ms | QPS:173K, P99.9: 1.26ms, P99: 0.9ms |
42+
| | |
43+
44+
2. GETs (`--ratio 0:1`):
45+
46+
| Redis | DF |
47+
| ----------------------------------------|----------------------------------------|
48+
| QPS: 194K, P99.9: 0.8ms, P99: 0.65ms | QPS: 191K, P99.9: 0.95ms, P99: 0.8ms |
49+
50+
The benchmark above shows that the algorithmic layer inside DF that allows it to scale vertically
51+
does not take a large toll when running single-threaded.
52+
53+
However, if we take a bit stronger instance (m5.xlarge), the gap between DF and Redis starts growing.
54+
(`memtier_benchmark -c 20 --test-time 100 -t 6 -d 256 --distinct-client-seed`):
55+
1. SETs (`--ratio 1:0`):
56+
57+
| Redis | DF |
58+
| ----------------------------------------|----------------------------------------|
59+
| QPS: 190K, P99.9: 2.45ms, P99: 0.97ms | QPS: 279K , P99.9: 1.95ms, P99: 1.48 |
60+
61+
2. GETs (`--ratio 0:1`):
62+
63+
| Redis | DF |
64+
| ----------------------------------------|----------------------------------------|
65+
| QPS: 220K, P99.9: 0.98ms , P99: 0.8ms | QPS: 305K, P99.9: 1.03ms, P99: 0.87ms |
66+
67+
68+
Dragonfly throughput capacity continues to grow with instance size,
69+
while single-threaded Redis is bottlenecked on CPU and reaches local maxima in terms of performance.
70+
3171
<img src="http://static.dragonflydb.io/repo-assets/aws-throughput.svg" width="80%" border="0"/>
3272

33-
In benchmarks, Dragonfly showed a 25X increase in throughput compared to Redis, crossing 3.8M QPS on c6gn.16xlarge.
73+
If we compare Dragonfly and Redis on the most network-capable instance c6gn.16xlarge,
74+
Dragonfly showed a 25X increase in throughput compared to Redis single process, crossing 3.8M QPS.
3475

3576
Dragonfly's 99th percentile latency metrics at its peak throughput:
3677

docs/faq.md

Lines changed: 39 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,50 @@
11
# Dragonfly Frequently Asked Questions
22

3-
- [What is the license model of Dragonfly? Is it an open source?](#what-is-the-license-model-of-dragonfly-is-it-an-open-source)
4-
- [Can I use dragonfly in production?](#can-i-use-dragonfly-in-production)
5-
- [Dragonfly provides vertical scale, but we can achieve similar throughput with X nodes in a Redis cluster.](#dragonfly-provides-vertical-scale-but-we-can-achieve-similar-throughput-with-x-nodes-in-a-redis-cluster.)
6-
- [What if I have some commands that are missing?](#what_if_i_have_some_commands_that_are_missing)
3+
- [Dragonfly Frequently Asked Questions](#dragonfly-frequently-asked-questions)
4+
- [What is the license model of Dragonfly? Is it an open source?](#what-is-the-license-model-of-dragonfly-is-it-an-open-source)
5+
- [Can I use dragonfly in production?](#can-i-use-dragonfly-in-production)
6+
- [We benchmarked Dragonfly and we have not reached 4M qps throughput as you advertised.](#we-benchmarked-dragonfly-and-we-have-not-reached-4m-qps-throughput-as-you-advertised)
7+
- [Dragonfly provides vertical scale, but we can achieve similar throughput with X nodes in a Redis cluster.](#dragonfly-provides-vertical-scale-but-we-can-achieve-similar-throughput-with-x-nodes-in-a-redis-cluster)
8+
- [If only Dragonfly had this command I would use it for sure](#if-only-dragonfly-had-this-command-i-would-use-it-for-sure)
79

810

911
## What is the license model of Dragonfly? Is it an open source?
10-
Dragonfly is released under [BSL 1.1](../LICENSE.md) (Business Source License). We believe that a BSL license is more permissive than AGPL-like licenses. In general terms, it means that dragonfly's code is free to use and free to change as long as you do not sell services directly related to dragonfly or in-memory datastores.
11-
We followed the trend of other technological companies like Elastic, Redis, MongoDB, Cockroach labs, Redpanda Data to protect our rights to provide service and support for the software we are building.
12+
Dragonfly is released under [BSL 1.1](../LICENSE.md) (Business Source License).
13+
BSL is considered to be "source available" license and it's not strictly open-source license.
14+
We believe that a BSL license is more permissive than licenses like AGPL, and it will allow us to
15+
provide a competitive commercial service using our technology. In general terms,
16+
it means that Dragonfly's code is free to use and free to change as long as you do not sell services directly related to
17+
Dragonfly or in-memory datastores.
18+
We followed the trend of other technological companies like Elastic, Redis, MongoDB, Cockroach labs,
19+
Redpanda Data to protect our rights to provide service and support for the software we are building.
1220

1321
## Can I use dragonfly in production?
14-
License wise you are free to use dragonfly in your production as long as you do not provide dragonfly as a managed service. From a code maturity point of view, Dragonfly's code is covered with unit testing. However as with any new software there are use cases that are hard to test and predict. We advise you to run your own particular use case on dragonfly for a few days before considering production usage.
22+
License wise you are free to use dragonfly in your production as long as you do not provide Dragonfly as a managed service.
23+
From a code maturity point of view, Dragonfly's code is covered with unit testing and the regression tests.
24+
However as with any new software there are use cases that are hard to test and predict.
25+
We advise you to run your own particular use case on dragonfly for a few days before considering production usage.
26+
27+
## We benchmarked Dragonfly and we have not reached 4M qps throughput as you advertised.
28+
We conducted our experiments using a load-test generator called `memtier_benchmark`,
29+
and we run benchmarks on AWS network-enhanced instance `c6gn.16xlarge` on recent Linux kernel versions.
30+
Dragonfly might reach smaller throughput on other instances, but we would
31+
still expect to reach around 1M+ qps on instances with 16-32 vCPUs.
1532

1633
## Dragonfly provides vertical scale, but we can achieve similar throughput with X nodes in a Redis cluster.
17-
Dragonfly utilizes the underlying hardware in an optimal way. Meaning it can run on small 8GB instances and scale vertically to large 768GB machines with 64 cores. This versatility allows to drastically reduce complexity of running cluster workloads to a single node saving hardware resources and costs. More importantly, it reduces the complexity (total cost of ownership) of handling the multi-node cluster. In addition, Redis cluster-mode imposes some limitations on multi-key and transactional operations while Dragonfly provides the same semantics as single node Redis.
34+
Dragonfly optimizes the use of underlying hardware, allowing it to run efficiently on instances as small as 8GB,
35+
and scale vertically to large 2TB machines with 128 cores. This versatility significantly
36+
reduces the complexity of running cluster workloads on a single node, saving hardware resources and costs.
37+
More importantly, it diminishes the total cost
38+
of ownership associated with managing multi-node clusters. In contrast, Redis in cluster
39+
mode imposes limitations on multi-key and transactional operations, whereas Dragonfly maintains
40+
the same semantics as a single-node Redis system.
41+
Furthermore, scaling out horizontally with small instances can lead to instability
42+
in production environments.
43+
We believe that large-scale deployments of in-memory stores require both vertical and horizontal scaling,
44+
which is not efficiently achievable with an in-memory store like Redis.
1845

1946
## If only Dragonfly had this command I would use it for sure
20-
Dragonfly implements ~130 Redis commands which we think represent a good coverage of the market. However this is not based empirical data. Having said that, if you have commands that are not covered, please feel free to open an issue for that or vote for an existing issue. We will do our best to prioritise those commands according to their popularity.
47+
Dragonfly implements ~190 Redis commands which we think represent a good coverage of the market.
48+
However this is not based empirical data. Having said that, if you have commands that are not covered,
49+
please feel free to open an issue for that or vote for an existing issue.
50+
We will do our best to prioritise those commands according to their popularity.

0 commit comments

Comments
 (0)