Manual cache settings - roadblock to full qBittorrent usage

Other platforms, generic questions.
Post Reply
sling-shot

Manual cache settings - roadblock to full qBittorrent usage

Post by sling-shot »

How to duplicate the following behaviour regarding cache in qBittorrent? This is preventing me from switching over from uTorrent.

Manually specify disk cache size at 1 GB.
Cache disk writes until at least a piece is complete or longer.
Cache all disk reads until cache is full.

Please see the attachment which shows my current settings in uTorrent.
Attachments
uTorrent Preferences Cache.PNG
ciaobaby

Re: Manual cache settings - roadblock to full qBittorrent usage

Post by ciaobaby »

Reduce the cache, having a 1GiB is unnecessary AND inefficient.

Why on earth would you want to actually run a BitTorrent client so poorly?????
sledgehammer_999
Administrator
Administrator
Posts: 2443
Joined: Sun Jan 23, 2011 1:17 pm

Re: Manual cache settings - roadblock to full qBittorrent usage

Post by sledgehammer_999 »

Go to the advanced options. You can set the cache size there and the cache expiry.
cache_expiry is the number of seconds from the last cached write to a piece in the write cache, to when it's forcefully flushed to disk. Default is 60 second.
sling-shot

Re: Manual cache settings - roadblock to full qBittorrent usage

Post by sling-shot »

[quote="ciaobaby"]
Reduce the cache, having a 1GiB is unnecessary AND inefficient.

Why on earth would you want to actually run a BitTorrent client so poorly?????
[/quote]

If I have the resources to do it, then how is it unnecessary and inefficient? Please tell me if I am doing it wrong.
Because my thinking is I want the least hard disk activity possible at the cost of memory use. And I generally run torrents when I am not actively using the computer for anything else because my bandwidth is only 512 Kbps and I cannot do any decent browsing while the torrents run. And when I do not use the computer why not let the torrent client make best use of available RAM.
sling-shot

Re: Manual cache settings - roadblock to full qBittorrent usage

Post by sling-shot »

sledgehammer_999 wrote: Go to the advanced options. You can set the cache size there and the cache expiry.
cache_expiry is the number of seconds from the last cached write to a piece in the write cache, to when it's forcefully flushed to disk. Default is 60 second.
Thank you for the reply. I have some doubts.

1. Disk write cache size - Does it mean only cache for disk writes and not disk reads or that write just refers to cache writing itself? My goal is to cache both reads and writes. Write cache is so that only completed piece or pieces should be written to disk. Read cache to go on progressively contain as much of the content as can be fitted into available memory for cache so that whenever a second, third request etc come for the same it is always served from RAM instead of disk.

2. Disk cache expiry interval - What does this refer to - write cache or read cache? Further defining a numerical value to achieve my target could be difficult. Depending on the individual piece size across different torrents the time needed to collect a complete piece will vary. The disk reads will have to be cached indefinitely until the cache itself gets full and then older pieces could be discarded. How to achieve this?
sledgehammer_999
Administrator
Administrator
Posts: 2443
Joined: Sun Jan 23, 2011 1:17 pm

Re: Manual cache settings - roadblock to full qBittorrent usage

Post by sledgehammer_999 »

There is only one cache for both writes/reads. I don't think you can achieve your other goals. Libtorrent doesn't have settings for those.
ciaobaby

Re: Manual cache settings - roadblock to full qBittorrent usage

Post by ciaobaby »

It is NOT what resources you think you can spare, but you should only tie up resources that can be actually required.

BitTorrent clients handle data in 16kiB blocks and it is the number of BLOCKS that are active at any one time that require caching NOT the entire payload or complete 'pieces'. When your client is downloading and has a much larger cache than required it writes more data to the drive every time, which takes longer than writing small amounts of data more often. The hard drives do not need to 'spin up' and 'spin down' as often which reduces the write time and lets the drive interface handle the write queue more efficiently, it also reduces the wear and tear on the drive, because it is the continual stop - start processes than more  damage than leaving them running at full speed all the time does.

If you have ten or twelve VERY active jobs  a cache of 256kiB - 384kiB is more than enough, that gives space for 20 - 25 blocks at any one time, for the average 'casual' user  128kiB is more than ample.
Don't be fooled with  the "more is better" dumb arse "Speed up BitTorrent" videos on YouTube, following their examples is more likely to screw up your data rates.

'Enough'  is better. Same with trying to get more "Free memory" as displayed by Windows Task Manager, in that  "Free Memory" is wasted memory, because it means that applications cannot use it for some reason, 'Free' doesn't mean 'available', 'free' means 'not going to be used',
sling-shot

Re: Manual cache settings - roadblock to full qBittorrent usage

Post by sling-shot »

This explanation makes more sense. So keeping the hard disk constantly spinning is better for its life than doing random read/writes.

I read through a page of rasterbar manual where it says setting cache to -1 makes it free memory/8. But qBittorrent itself does not seem to support negative values. 0 is the least and it makes cache auto.

Looks like I will just have to go with auto then.
sledgehammer_999
Administrator
Administrator
Posts: 2443
Joined: Sun Jan 23, 2011 1:17 pm

Re: Manual cache settings - roadblock to full qBittorrent usage

Post by sledgehammer_999 »

cache_size is the disk write and read cache. It is specified in units of 16 KiB blocks. Buffers that are part of a peer's send or receive buffer also count against this limit. Send and receive buffers will never be denied to be allocated, but they will cause the actual cached blocks to be flushed or evicted. If this is set to -1, the cache size is automatically set to the amount of physical RAM available in the machine divided by 8. If the amount of physical RAM cannot be determined, it's set to 1024 (= 16 MiB).
The gui shows 0(auto) and internally we map that to -1
sling-shot

Re: Manual cache settings - roadblock to full qBittorrent usage

Post by sling-shot »

OK. I have no further questions. Thank you all.
Post Reply