-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Bump file pool size #14966
Bump file pool size #14966
Conversation
Hope it doesn't exceed any system limits... |
Some systems may have lower file descriptor limits. But in windows I haven’t heard of any limitations. If this exceeds system limits then qBt would be limited to that number instead by the kernal without any undesired effects. |
We can make this change limited to Windows only if we’re concerned about hitting file descriptor limits and failing to keep files/connections open. |
Just to chime in here - my Have seen issues before where just raising Example
I believe it will also help when closing qbittorrent - the process seems to exit/disappear quicker in task manager The accessing/updating of the EDIT: |
I believe windows has a much higher default limit for number of file handles, than Linux and MacOS. It might make sense to have different defaults for different systems. Opening files with exclusive access isn't really a problem on non-windows either. |
for reference: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As others have mentioned, I too have seen instances where bumping this definitely helped. Combined with the fact that on Windows there is practically no limit, and the fact that other systems don't really have issues due to opening with exclusive access, I think this is a welcome change.
@An0n666 |
Reason no 1: Performance:
https://www.libtorrent.org/tuning.html#file-pool
libtorrent keeps an LRU file cache. Each file that is opened, is stuck in the cache. The main purpose of this is because of anti-virus software that hooks on file-open and file close to scan the file. Anti-virus software that does that will significantly increase the cost of opening and closing files. However, for a high performance seed, the file open/close might be so frequent that it becomes a significant cost. It might therefore be a good idea to allow a large file descriptor cache. Adjust this though settings_pack::file_pool_size
Reason no 2: Potential I/O errors:
The error:
#14962 (comment)
Most likely cause:
#14962 (comment)
So basically when the file was closed, some other application(most likely antivirus) opened it for exclusive access, thus resulting in I/O errors when qBt tried to re-open it. If the file pool was large enough there'd be no need to close and reopen files so frequently as to cause collition with other apps.
P.S - I'm not sure what might be a good number for this settings. But I've seen many people use this number(5000) when they tune libtorrent. If keeping too many file descriptors open doesn't incur a much higher cost in comparison to gained performance then it might be worth it to bump this.