Nik Spyratos

Redis on Ubuntu - Snap or Apt?

Table of Contents


I noticed Redis is available via both Snap and APT on Ubuntu. There also seems to be a lack of performance comparison out in the wild, so I thought I'd give it a shot. This is part of some research I'm doing into how to effectively use "small" tech stacks in indie projects.

This is a super simple analysis using the redis-benchmark utility, and throwing the outputs into ChatGPT with the Code Interpreter to analyse.

Disclaimer

Of course, I'm not someone privy to the inner workings of Redis, Snap or APT, and this benchmark might not reflect real-world usage. However I think it's an interesting comparison point to have and I wanted to sate my curiosity.

The benchmarking was conducted on a 1GB RAM, 1 Intel vCPU Digital Ocean droplet. I'm sure results may vary further in different hardware configurations.

The Results

To be honest, I was surprised. I was always under the impression Snap was slower, but it seems it was a bit faster in this scenario. Here's the results across the various tests that redis-benchmark conducts in a completely stock benchmarking run:

In general, Redis installed via Snap showed higher throughput and lower average latency for most operations compared to APT. However, in a few cases, the APT installation performed better. For example, for the RPOP, SADD, HSET, LPUSH, LRANGE_500, and LRANGE_600 operations, the APT installation showed better performance.

Caveats

By the benchmark documentation's own notes, there are some confounding factors here. For example CPU, RAM speed, and Virtualisation.

Given that there were several operations in which APT Redis performed better, the question becomes: are these operations more important for the average use case in a caching and queue scenario?

#linux #niksoftware #redis #snap #ubuntu