How to improve network speed on Hetzner Storage Box
If you are using Hetzner Storage Box for backups or other large file operations, and you get low throughput (~2MB/s) you are most likely running into a latency issue that can be easily fixed.
Lets say you live in the US and your box is in Europe, the latency will most likely be quite high, ranging anywhere from 80 to 200+ ms. This is enough to cripple your throughput because when using transport protocols such as WebDAV, you are constantly waiting for acknowledgements before more data is sent.
The simplest solution would be to move your client or server closer to your storage box, but that is often not a viable solution. Instead, we can ignore the latency problem and simply brute force throughput through the power of parallel transmissions.
Instead of connecting apps such as Immich or Nextcloud directly to the storage box via a WebDav adapter, we can use rclone to locally mount the storage box.
First we use rclone to create a remote that uses WebDAV to connect to the storage box. Then we use the following command to mount the storage box locally:
rclone mount remotename: /mount/path/here/
--config /config/file/here.conf
--cache-dir /cachedir
--allow-other
--vfs-cache-mode full
--vfs-read-chunk-streams 64
--vfs-read-chunk-size 32M
--transfers 64
--buffer-size 128MBy having 64 streams in parallel we saturate the connection even if many transmissions are idling while they wait for acknowledgements. Any time a massive amount of reads or writes are requested from the mount path, dozens of transmissions will work in parallel to maximize the throughput. This is great for backups where whole folders are moved, with the only major downside of not increasing the maximum transfer speed for individual files.
By using this setup, you can reduce the amount of time your backups or restore take from hours to mere minutes. Using this method I've increased the backup speed of my US VPS from 4MB/s to well over 800MB/s.