I’ve a RPi4 2gb running DietPi v8.23.3 (fully upgraded, every package upgraded, no upgrade notification) and booting off a Samsung T7 2TB SSD (via USB3), headless.
I’m running the following services, everything installed via dietpi-software:
qBittorrent: using webUI for torrenting via the RPi4 from other devices on lan.
Samba: managing the T7, I’ve setup a folder SMB in /mnt/dietpi_userdata, gave the permissions and ownership to dietpi user and setup this folder as the Samba share. I’ve qBittorrent’s downloads, movies and tv series for Plex here.
Plex: streaming movies and tv series.
WireGuard: still have to setup so just installed but never used.
I’ve been running everything smooth and happily, using an Argon NEO so low temps too but I’ve got a couple of questions:
I’ve seen a bunch of people using the T7 but the specs on the disk say 5V/1.5A and the RPi4’s USB ports share a maximum of 1.2A.
I Was previously running a WD Elements 1TB (via USB3) without any problems, the T7 is running fine too for now.
Should I be worried?
I’m having an hard time understanding how swap works.
While torrenting I see (via DietPi Dashboard, statistics page) always low ram usage (always under 200mb) but 50-75% of swap space used, checking the processes page I see qBittorrent using 1GiB.
Which one is corrent and what do I have to do?
We recommend that external USB devices are powered by themselves and not only by the USB ports of the RPi. Especially on the RPI4, not using an external power supply could cause problems with the file system, as the USB ports of the RPi4 are not designed to power things larger than a USB stick.
You simply run out of memory. In such cases, SWAP is used to allow the system to use more memory. However, this has an impact on performance because SWAP is much slower in the file system than physical memory. It would be best not to use SWAP at all However, this is not possible in your case as your system needs this amount and your RPI only offers 2 GB of memory. Make sure you have enough SWAP memory available. You can increase the SWAP memory space if necessary. If the SWAP memory space is also exceeded, your system will start to abort processes.
Following should show total memory usage
free -m
Alternatively, think of an SBC with 4 or 8 GB of memory.
I wouldn’t use swap when loading torrents. Network is used, also the bus to your hdd (not sure if this bus is also shared with network) and then you will also copy data from RAM also to hdd, I think the RPi will just freeze
Maybe it’s a better approach to limit the RAM usage of qbittorrent
When your system memory is full, it will use the swap file, which is located on the hard disk. This copy processes, from ram to hdd and vice versa, will slow down the system significantly. I think by default swap is also disabled, bc of this reason.