Skip to main content

What can you get today for under $1? Would you guess 23 billion ops out of your Database?

Today ARM processors are becoming a cost effective way of computing providing great bang for your buck… and now they are in the cloud! This begs to question whether your setup is still the most economical means for serving your customers.

The intent of this article is to go over the numbers, compare machines, and demonstrate what kind of performance/cost you should be able to get with the latest hardware and software readily available. This article uses the open source database, KeyDB,which is a high performance fork of Redis that works well on ARM processors. It is fully compatible with Redis protocols and API’s, and contains many other sought after features that are open source.

An a1.xlarge EC2 ARM instance costs about 4cents/hour for a reserved instance (up to 10cents/hr on demand). With this instance we are able to average about 260,000 ops/sec with a single database instance. No shards, just a single instance running with 3 threads enabled on the 4 core machine.

AWS pricing used in this article can be found here.

The testing was performed on an a1.xlarge instance. KeyDB was configured to run with 3 threads enabled, and all other settings default. Memtier was used in order to perform the benchmarking. This was done on an m5.2xlarge instance with 7 threads enabled. A larger machine is used to ensure the bechmarking machine is not the bottleneck.

The below chart shows ops/sec at different data sizes.

image

The chart below shows latency associated with this test.

image

The above testing was done with the following Memtier command: memtier_benchmark -s ipaddress -p --threads=7 --data-size= . Note that if your results vary you can increase the # requests above the default, ie. --requests=30000. The results from the benchmark tests are the average obtained. You may see higher numbers. Note that pipelining is NOT used for these tests

With an assumption of 260,000 ops/sec which is performed at default parameters, assuming 3.8cents/hr, this equates to 22.46 billion per day, for about $0.912. Or 24.6billion ops per dollar spent.

How does this compare to other EC2 instances?#

Lets take a quick look at a few other machines to compare (a1.xlarge is 4core, 8GB). Lets compare to a m5.xlarge (4core, 16GB), c5.xlarge (4core, 8GB), and m5.large (2core, 8GB). It is evident that the a1 series is the most cost effective solution when it comes to volume served. Regarding performance the a1.xlarge gets about 30% more ops/sec than the m5.large, and about 30% less than the m5.xlarge and c5.xlarge.

image

The above numbers were calculated by taking the ops/sec of the benchmark, cost of the instance (standard 3-yr term, upfront, reserved instance pricing, and normalizing for cost per 20 billion ops

What else should I consider to be more economical?#

So the a1 provides good bang for your buck, however when selecting machines you might also be looking at the storage limitations of the instance, computing power, and high availability configurations. There are options that can allow you to optimize to your specific needs without breaking the bank. If your setup requires more to serve your customers, you can customize your instance further with some of these options with KeyDB:

  • If you require high availability and have to run a second instance, run it as an active-replica which allows you to essentially run 2 masters that sync while continuing to increase your performance. Check out this article to see the benefits.
  • Use flash storage to effectively increase RAM. Add SSD storage to the EC2 instance and set it up to compliment the RAM usage.
  • Use AWS S3 storage to backup your database. This is cheaper than adding EBS. This option is integrated into KeyDB

Depending on your setup requirements, the a1 option can be considered with configurations up to 16 cores with the a1.4xlarge. KeyDB is fully multithreaded and you can enable a single instance to run on many cores. Obviously clustering and horizontal scaling can also remove boundaries for size limitations.

Hopefully this article provides some insight and we encourage you to try this test for yourself. Obtain a copy of the open source database from Github. If you want to learn more about KeyDB or features mentioned above, check out the website here