-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
v4.4.X.X x64 - Insane memory usage(Linux) #17650
Comments
Hi, |
Okay the image has been updated to 4.4.5 and libtorrent 2.0.7.0 ill report back if that changes anything. |
Kinda known problem with libtorrent 2.0.x which is being worked on on the libtorrent side. |
This comment was marked as off-topic.
This comment was marked as off-topic.
Unfortunately qBit still seems to use a bunch of memory until OOM killer kills it :( As before the log file doesn't show anything useful, my settings haven't changed. |
The machine qBit is running on is a headless machine, is there a way to enable the webui via cli when using the appimage (i was thinking of using the appimage as it seems to run v1.2.17 and I don't control the versions the docker image uses)? i can only see there's an argument for changing the webui port but that doesn't seem to enable the webui itself. |
Unfortunately the appimage is using gui libraries so it probably can't work under headless. However, can you try setting
NOTE: The above change is temporary. It will be lost with a reboot. |
Hi, |
Unfortunately that didn't change anything either :( |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
@andry81 @PriitUring I hid your comments as "offtopic" because the original user here is using Linux. IIRC there are other issues discussing windows ram usage. Let's not drown this issue with Windows problems/solutions. |
Did it still kill qbittorrent? |
Yeah it did, I've disabled the ram limit on the docker container and I'll try with it set to 500. |
Any other things I can try? |
Why don't try to return back to 4.4.3.1? It does work for Windows and might work for Linux. |
Some other suggestions: Diagnostics Possible solutions
|
I tried that after the release of 4.4.X.X but I believe I had to recheck all my torrents after downgrading so I ended up using the latest version instead as rechecking all my torrents would take forever.
I'll try to catch it when it's using a bunch of memory and post the result.
I've done that now, we'll see if that helps anything.
I can try, is there really a difference between putting qbit in a cgroup versus limiting the memory usage via docker? |
I am not well versed with docker. It is possible that docker's memory limiting uses cgroups behind the scenes.
If the extra memory is used for OS cache/buffers then it should evict the cache more aggressively to reclaim memory. If not, then (I suppose) the OS might kill processes in the same cgroup to stay below the limit (aka it will kill qbittorrent). |
Here's the output of
Note that I disabled OS cache in qBit when running this test. |
Apparently the caches are only 758MB in size. So the 10GB is used by qbt directly.
My mistake for not clarifying. I would like to see
|
What are your max # of open files set to witih QBT? mines below 60 and my resident memory is ~5800MB. Settings -> Advanced -> File Pool Size Virtual memory is way different than resident. resident is what you care about. |
I've downgraded and it works as is. Yes, not so fast but in the same time is not so long. Anyway, you can backup all your configs and fastresume files manually before downgrade at any time. |
Yup, it runs other stuff like Sonarr, Radarr and Transmission, though most of it is probably used as cache for ZFS.
Okay, will enable OS cache and do it again.
I'll try this too.
I'll probably downgrade as a last resort. |
@sledgehammer999 here is the output of
Here's the output of the "drop cache" command:
On a side note it seems it mostly "released" the cache ZFS had. @thisisnotmyrealname it's set to 5000, I believe that's the default. |
As suggested by @thisisnotmyrealname, I drastically lowered the number of open files and it seems to have fixed it for me 👍🏻 |
Hmm okay thanks, I'll try it out. |
Tried changing it to 50, qBit is atm consuming 15 GB of ram :c |
Okay thanks @randellhodges , I'll try hotio's image instead. |
I can confirm that all of these issues are because of libtorrent v2 Everything works great with libtorrent v1.2.18 |
It's basically because libtorrent v2 uses mmap now. As a result in linux the cached files show up in RSS. But, Linux will uncache these files just like regular file cache using LRU. If you want to force it to uncache files quicker, lower "File pool size" in advance settings. Qbittorrent sets this to 5k by default which basically prevents libtorrent from ever unmapping any file. As a result, you end up with completely unused files stuck using FS cache (although Linux will uncache them after a while based on LRU). It's probably best to set this to a much lower value (maybe the default 40) so libtorrent proactively unmaps files. |
@HanabishiRecca can you weigh-in on this ticket? |
What exactly do you want to know? This is a typical libtorrent 2.0 / memory-mapped files issue. And that's the problem I'm trying to resolve right now at qBittorrent side in #21300. |
qBittorrent & operating system versions
qBittorrent: v4.4.3.1 x64
OS: Debian 11
Qt: 6.3.0
Libtorrent: 2.0.6.0
32 GB RAM
Additional: qBit is running in a docker container using the latest image from linuxserver.io that uses alpine linux.
What is the problem?
I should preface this by saying that I've had this problem for a while, I just kinda hoped it would fix itself, but i got tired of waiting.
qBit will gladly eat up 16+ GB if memory until it gets killed by OOM killer (Below is a pic of it using 10 GB of memory:
![qbitlol](https://user-images.githubusercontent.com/85888808/187779175-e0bc9d14-73f8-4542-ab24-af54e1b20612.png)
I currently have 1k torrents active, this problem seem to have appeared after upgrading to version 4.4.X.X, it seems similar to #17309.
Additionally torrents I've added or removed will sometimes disappear after qBit is restarted by docker or OOM killer which makes qBit pretty much unusable.
I've tried using a few other qBit images from docker hub but they all result in the same issue.
Steps to reproduce
Additional context
I've put a limit of 6 GB memory usage on the docker container itself, these are the docker container logs every time it gets restarted:
2022-08-31T00:23:55.946709627Z
2022-08-31T00:23:55.947000814Z ******** Information ********
2022-08-31T00:23:55.947010515Z To control qBittorrent, access the WebUI at: http://localhost:8080
2022-08-31T00:26:01.496767580Z qt.network.http2: stream 1 finished with error: "Connection closed"
2022-08-31T02:18:07.172354902Z
2022-08-31T02:18:07.172894002Z ******** Information ********
2022-08-31T02:18:07.173009875Z To control qBittorrent, access the WebUI at: http://localhost:8080
2022-08-31T02:18:56.446415076Z qt.network.http2: stream 1 finished with error: "Connection closed"
2022-08-31T04:20:12.130889920Z
2022-08-31T04:20:12.131330667Z ******** Information ********
2022-08-31T04:20:12.131359503Z To control qBittorrent, access the WebUI at: http://localhost:8080
2022-08-31T04:20:47.784849538Z qt.network.http2: stream 1 finished with error: "Connection closed"
2022-08-31T06:20:27.451137030Z qt.network.http2: stream 1 finished with error: "Connection closed"
2022-08-31T06:20:27.453306236Z qt.network.http2: stream 1 finished with error: "Connection closed"
2022-08-31T06:34:14.645288197Z
2022-08-31T06:34:14.645656521Z ******** Information ********
2022-08-31T06:34:14.645669663Z To control qBittorrent, access the WebUI at: http://localhost:8080
2022-08-31T06:35:05.353536265Z qt.network.http2: stream 1 finished with error: "Connection closed"
2022-08-31T06:35:05.380552648Z qt.network.http2: stream 1 finished with error: "Connection closed"
2022-08-31T06:35:05.380606846Z qt.network.http2: stream 3 finished with error: "Connection closed"
2022-08-31T08:28:18.837927938Z
2022-08-31T08:28:18.838172681Z ******** Information ********
2022-08-31T08:28:18.838187366Z To control qBittorrent, access the WebUI at: http://localhost:8080
2022-08-31T08:29:14.221791584Z qt.network.http2: stream 1 finished with error: "Connection closed"
2022-08-31T10:28:24.067455827Z
2022-08-31T10:28:24.067683581Z ******** Information ********
2022-08-31T10:28:24.067692607Z To control qBittorrent, access the WebUI at: http://localhost:8080
2022-08-31T10:29:26.379433784Z qt.network.http2: stream 1 finished with error: "Connection closed"
2022-08-31T12:26:29.100403377Z
2022-08-31T12:26:29.101100365Z ******** Information ********
2022-08-31T12:26:29.101136964Z To control qBittorrent, access the WebUI at: http://localhost:8080
2022-08-31T12:27:28.103326204Z qt.network.http2: stream 1 finished with error: "Connection closed"
2022-08-31T14:28:34.599028389Z
2022-08-31T14:28:34.599643332Z ******** Information ********
2022-08-31T14:28:34.599688616Z To control qBittorrent, access the WebUI at: http://localhost:8080
2022-08-31T14:29:31.523323642Z qt.network.http2: stream 1 finished with error: "Connection closed"
2022-08-31T16:32:36.193621877Z
2022-08-31T16:32:36.194006588Z ******** Information ********
2022-08-31T16:32:36.194023346Z To control qBittorrent, access the WebUI at: http://localhost:8080
2022-08-31T16:33:36.700893552Z qt.network.http2: stream 1 finished with error: "Connection closed"
2022-08-31T18:30:39.131304315Z
2022-08-31T18:30:39.132063194Z ******** Information ********
2022-08-31T18:30:39.132095867Z To control qBittorrent, access the WebUI at: http://localhost:8080
2022-08-31T18:31:27.655796523Z qt.network.http2: stream 1 finished with error: "Connection closed"
Log(s) & preferences file(s)
My config file:
qBittorrent_conf.txt
The logs file just shows a bunch of torrents being restored and my RSS feeds being downloaded. (Didn't add it since I'd have to redact all of it anyways)
The text was updated successfully, but these errors were encountered: