Questions about how transmission handles cache

Ask for help and report issues not specific to either the Mac OS X or GTK+ versions of Transmission
Post Reply
Undercover
Posts: 3
Joined: Fri Aug 28, 2020 11:42 am

Questions about how transmission handles cache

Post by Undercover »

Hi there,

I have a couple of questions on how transmission handles cache and how to optimize my system further. My system is as follows:
- Host: Raspberry Pi 4
- RAM: 1 GB
- OS: Manjaro ARM
- Memory: 64 GB SD card (/ and /boot) and 1 TB HDD (/mnt/library)

As you can tell my system is pretty weak, but that's fine because I rarely download torrents, I'm more of a perma-seeder and I wanted to optimize as such. Because my system is very low on RAM and I have other processes running my guess what to increase the cache, however, I have no idea where the cache folder is currently located, its not in /var/lib/transmission/.cache (because I run it as a separate user) or in any of the temporary locations that I know of.

With that in mind, and a few other things, I have a few questions I haven't found the answer to:
1 - Is cache actually in RAM? Because if so, increasing cache of my system could be a disaster.
2 - Is cache on a torrent-based level or on a global level? Does setting cache-size-mb = x means I have x MB for transmission or x MB for each torrent?
3 - Where is the cache used for transmission? Because downloads are going to the HDD but having it cached there is stupid and as such cache should be in the SD card, right?

My goal here is to decrease RAM and HDD usage, as I'm pretty sure my SD card can handle most of it (it does have wear leveling).
So it seems that increasing cache (assuming that cache is on the SD card) would be a good idea, because the following would happen:
- Peer requests file(s)
- HDD reads a big chunk of those file(s) and sends it to the SD card
- HDD now goes to rest, SD card does the work
- SD card run out of cache repeat from process 2 until there's no more file(s) to send

This seems really smart, assuming that the cache is big enough compared to the speed between the HDD <-> SD card and to the speed I'm seeding.

Lets go for an example: If I'm seeding something at 2 MB/s and I have a 4 MB cache, then it would be really stupid to have any cache at all on the SD card, because the HDD would rest for 2 seconds before getting triggered again. If the cache were 400 MB on the other hand, and HDD <-> SD card was something like 40 MB/s, then the HDD would work for 10 seconds and rest 200 seconds, which is a big improvement.

Are my assumptions correct or doesn't cache work like that? Considering I download things very rarely, and I don't mind slower speeds, how should I optimize my system to have the lowest HDD wear possible and increase free RAM?

Thanks in advance!
Post Reply