-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fasresume saving causes too much writes to disk #9152
Comments
@reyaz006 Of course, if you download many, many large torrents, the data from the torrents themselves can certainly be significant. |
840 Pro. It lived less than 5 years, and most of this time I've used qBittorrent. I didn't even had a swap file on it, and I'm pretty sure I was careful enough to not overuse the TEMP folder on it. I don't recall any other application that would write that much data on it, except qBittorrent.
Even if I don't use SSD as a download location? I never did. |
You did not mention in the OP, but from this I assume you are on a Linux system? Can you provide more details, such as version, etc? Meanwhile, you should wait for the reponse of the developers that I pinged in my previous post. I want to know more about fastresume saving as well (and I am not able to test/look through the code myself right now, too occupied with other stuff). |
Windows 8.1 x64. I also don't update it frequently. |
Only the very latest libtorrent versions do block writes and reads under qBitTorrent running on Windows, which means they caused immense write amplification -- over 10 times the size of the torrents. Older versions were doing 16 KB individual non-coalesced writes which meant SSDs had to do lots of block erases extremely often which is the hardest on them. |
qBittorrent periodically writes fastresume files (one file per torrent). Default interval is 3 minutes. You can configure it in Advanced Settings. |
I'd like to correct myself - where I said about 5 GB during 1 day on a new SSD, it's actually 50 GB. I got confused with the number in the application - the difference was 0.05 TB.
That can't solve the problem with excessive writing of largely unnecessary data by qBittorrent. Also, I may not be able to afford such hardware anyway.
I think you are not talking about "fastresume" data. |
@reyaz006 Workaround (yes I know it doesn't fix qbittorrent writing files at all) is to create a symbol link for qbittorrents folder where it writes the data to. https://superuser.com/questions/1020821/how-to-create-a-symbolic-link-on-windows-10 just link it to a folder on a different hard disk. |
Indeed he is not. He is talking about the way qbittorrent writes the files from a torrent themselves to disk on Windows, and he has a very important point. The problem is much more likely to be the (lack of) write coalescing on Windows - which was only fixed in libtorrent 1.1.8. Unfortunately, there is still no official qBittorrent version built against libtorrent 1.1.8. You have to wait or build it yourself, or try one of the experimental builds posted in related issues. Related issues: #9061 (the discussion focuses on performance, but the underlying problem is the same, the small 16 KiB writes). |
It's not impossible for qBt to write that many gigs per day. I for example have 111 torrents and my BT_backup folder is 4.76 MB. Assuming the default 3 min interval between saves that means about 2.2 GB per day, imagine someone with thousands torrents. Hmm i hadn't realized it was that much! Gonna try that symlink thing. |
Would it be reasonable to make the default 10 mins? |
I've considered this before posting, and I stand by my proposition - to discuss the ability to review and change the mechanics, including changing the folder in settings. Resorting to symbol links is not really a good thing to suggest for normal users who only want to keep their SSD safe. Also it's a good idea to tell everyone about this issue because most people aren't even aware from what I understand.
How about 120 minutes for default? And why not 1 minute or 30 seconds? I'd like to understand the logic behind those 3 minutes. If qBittorrent crashes, it'll have to recheck the files to proceed anyway (fastresume files are not needed for this). If it doesn't crash and gets shut down properly, it'll save those files anyway. Am I missing something? |
I would make it less paranoidal by default (30 or even 60 min). At least for completed torrents. |
So are there any downsides for case when I set it to 2^20 minutes? |
There is also some statistics saved in fastresume files. |
It would be nice to allow to disable intermediate fastresume saving, isn't it? |
Is there a good reason for this? "fastresume" seem to be about download progress. Statistics are something else. Wouldn't it make sense to use a separate db for statistics?
Unless I can understand what would that exactly mean for me, I can't decide. |
I believe for completed torrents the saving interval is only useful for statistics. Everything else are saved on the spot when there is a need e.g. change savepath. Well this issue certainly inspired me to greatly increase my saving interval. |
Do you mean setting the save interval to |
Currently it won't work since it unconditionally translated to QTimer interval. So we should change it. Also it would be better to display "disabled" instead of 0 there. |
It's the only way librorrent restore torrent state. Apparently it's time to think about some independent processing of this data. |
As a workaround, is there any way to move the fastresume files to a ramdisk location? (ie any tmpfs mounted folder) |
Didn't we come to the conclusion that the real issue was the write coalescing of the payload data? Or was I wrong there? Also, IMO 3 minutes is no problem for active torrents, I would simply increase that value for completed torrents. |
From thalieht's usage, it is hard to neglect its impact on SSD lifespan. |
I've tried the following:
Also, I think the following needs to be considered: Think about what would be the best way to count the interval. Are you sure you want it in minutes? Not in % of ratio or anything else? Some active torrents may be just stuck for weeks and months. Would it mean their meta data is still going to be rewritten many times even though there is no actual dl/ul progress? |
Again I'd like to mention the following points.
|
thalieht commented on Jul 3, 2018:
At this point it doesn't matter but i feel the need to say that i just discovered the .fastresume files are only a tenth of that size. The rest are from the .torrent files :) |
IMO this has been adequately addressed by #9161. |
It seems like qBittorrent was the main reason why my SSD recently died. It was a good one, MLC-based. I've started noticing reallocated sectors few months ago, and somehow haven't realized that it may die so soon.
On my new SSD, judging by the data from the vendor tool, around
5GB got written to it during 1 day.So it all seems to come to concern I was talking about in #4315 (comment) - every few minutes qBittorrent saves data about current torrents, even if no download progress has been made. I'm not quite sure about amounts of data that was being rotated on my disk daily with each qBittorrent version, but right now on latest v4.1.1 it seems smaller - my very rough guess is about
2-5GB per day. I think it was much bigger before - I remember that every single file was being re-written in BT_backup folder. My guess is that it was around15GB per day.I'd like to discuss the following:
Edit: It seems I was wrong about GB per day numbers, see my comments below.
The text was updated successfully, but these errors were encountered: