4

I found previous version was quite slow (3MB/s), but this newer Pi has more power.

What speeds can I expect with external hdd and standard installation of luks (I believe aes 256, xts, plain 64)?

1
  • forget hdd, try ssd.
    – tlfong01
    Commented Aug 31, 2019 at 4:40

4 Answers 4

7

I can see this question, the performance of Rasperry Pi 4 on LUKS, is old, but it is more relevant now than ever.

It is quite common to use LUKS with AES because CPUs (like Intel's, AMD's, etc) include AES acceleration in the CPU. This makes AES fast because encryption and decryption is performed by hardware. On the other hand, Raspberry Pi CPU's do not include AES acceleration, and this makes AES slow.

The situation has changed recently wih the creation of Adiantum encryption algorithm and its incorporation in Raspberry Pi OS's kernel modules. Adiantum was designed to be secure and fast in software, faster than AES in software. This allows LUKS on Raspberry Pi to be faster than before if Adiantum is used.

If someone wants to try it, this is a good guide that explains how to encrypt the SD card of a Raspberry Pi to use LUKS with Adiantum: https://rr-developer.github.io/LUKS-on-Raspberry-Pi/

1
  • any idea how much it impacts performance? so, how much do write speeds slow down, and what does it do to CPU load? are we talking about 10% or 80%?
    – robo
    Commented Jul 5, 2021 at 7:25
3

I have recently installed LUKS on a Raspberry Pi 4B with 4GB RAM. I'm using a Seagate Video 2.5HDD 1TB model ST100VT001, and transferring via LAN from a 500GB Samsung SSD.

I've checked, Adiantum is running. (Adiantum? Is that a precious metal from Avatar?)

My test is 128 files, total size 208GB. Windows10 predicts that it will take about 50 minutes. So far, the copy speed is fairly steady at 55 MB/s.

I expect the main limitation on speed to be the encryption process, as the SSD can supply data at 500 MB/s. My LAN is gigabit, so it maxes out at about 110MB/s. The hard drive should be able to accept data at around 100MB/s.

So I conclude that the RasPi 4B is encrypting at about 50MB/s which is pretty good all things considered.

And yes, this is my first post here.

2
  • 2
    "Is that a precious metal from Avatar?" No silly that was of course unobtainium. WRT the assumption that encryption is the bottleneck, this could be confirmed by checking the CPU usage during the process. If at least one core isn't maxed out, that's not it (I mention this because "the SSD can supply data at 500 MB/s" is very very idealized, methinks you would be lucky to get half that via USB 3.0 on a Pi 4, encryption or no). This is not critical to the value of your answer though.
    – goldilocks
    Commented Jan 2, 2022 at 15:29
  • This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From Review
    – Dougie
    Commented Jan 2, 2022 at 22:35
1

USB3 is about 10x faster than cryptography on the RPI 4 SOC which is missing hardware common to other SOCs in the same price and performance range.

aes-xts 512b benchmarks:

MiB/s,   Product
   9.7,  RPI 1
  18.8,  HiFive Unmatched (U740)
  22.5,  RPI 3
  42.2,  Odroid C2
  60.0,  USB2 ===
  66.1,  RPI 4
  76.2,  Odroid XU4
 221.2,  UP1
 240.3,  Orange Pi PC2, NanoPi NEO2 (AllWinner H5)
 267.0,  espressobin
 370.5,  ROCK64 (RK3328)
 570.6,  Odroid C4 (S905X3)
 625.0,  USB3 ===
 655.6,  Odroid N1, ROCKPRO64, etc (RK3399)
 666.1,  UP2 (N4200)
 704.2,  Odroid H2 (J4105)
 707.1,  Odroid N2 (S922X)
 826.1,  rackspace (E5-2670)
 985.1,  EC2 (AMD EPYC 7571)
1366.7,  EC2 (E5-2676)
1393.7,  old i5 (2500S)
2710.3,  Ryzen 1800X
2994.5,  i7-1165G7

https://forum.odroid.com/viewtopic.php?f=149&t=30103

0

The Pi 4 has USB 3.0, which I assume is what you plan to connect your external HDD over. The maximum bandwidth of USB 3.0 is 640 MB/s. (The Pi 3 had USB 2.0, which maxes out at 60 MB/s.) However, this is only the theoretical maximum speed.

It's hard to estimate the speeds you would get in practice, since software overhead will slow your R/W speed down.

1
  • luks (not usb) is the limiting factor. Commented Jan 21, 2022 at 14:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.