Gentoo Archives: gentoo-user

From: Dale <rdalek1967@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] qbittorrent crashes after to many files open error
Date: Thu, 08 Sep 2022 22:25:07
Message-Id: 222f8c2b-46ba-711a-d344-cd5e3a3e6b81@gmail.com
In Reply to: Re: [gentoo-user] qbittorrent crashes after to many files open error by Mateusz Okulus
1 Mateusz Okulus wrote:
2 >> root@fireball / # sysctl fs.file-max
3 >> fs.file-max = 3289952
4 >> root@fireball / # sysctl -w fs.file-max=32899520
5 >> fs.file-max = 32899520
6 >> root@fireball / # cat /proc/sys/fs/file-max
7 >> 32899520
8 > On my pc the limit is 2^63. But this is max files for kernel, which is
9 > different for max files per user and max files per process.
10 >
11 > For example if I run:
12 >
13 > $ grep 'Limit\|open' /proc/$(pgrep qbittorrent | head -1)/limits
14 > Limit Soft Limit Hard Limit Units
15 > Max open files 524288 524288 files
16 >
17 > 524288 = 2^19
18 >
19 > QBittorrent increases it's process limit to hard limit. With 10 TB of
20 > torrents it's hard to tell if it's a bug or just 500k files is not
21 > enough, I'd say it's probably the latter.
22 >
23 > It seems you can change the default hard limit in
24 > /etc/security/limits.conf
25 >
26 > For example:
27 >
28 > # 2^24, increased from 2^19
29 > * hard nofile 16777216
30 >
31 > Then after reloging:
32 >
33 > $ grep 'Limit\|open' /proc/$(pgrep qbittorrent | head -1)/limits
34 > Limit Soft Limit Hard Limit Units
35 > Max open files 16777216 16777216 files
36 >
37 > So this works, at least for me.
38 >
39 > Check also limits.conf man page.
40 >
41 > Regards,
42 > mmokulus
43 >
44 > .
45 >
46
47
48 It appears the change I made wasn't what was needed.  I took a nap,
49 after doing today what I used to do on Friday, which involves going to
50 Doctor, getting shots, then shopping around town etc etc.  Anyway, I
51 woke up to Qbittorrent being gone.  It crashed at some point.  In the
52 notification thingy, it had a few of the file open errors again.  So, I
53 ran some of the commands you posted, my hard limit was set to 4096.  I
54 whipped out my calculator and doubled it.  I set it in the limits.conf
55 file like so: 
56
57 root@fireball / # cat /etc/security/limits.conf | grep nofile
58 #        - nofile - max number of open file descriptors
59 *               hard    nofile          8192
60 root@fireball / #
61
62
63 I logged out and back in.  I ran the command you shared and it was
64 indeed set to the new amount.  I'm going to upgrade qbittorrent to the
65 new version again and test it some more. 
66
67 Thanks much for the help.  Maybe this will fix it.
68
69 Dale
70
71 :-)  :-) 

Replies

Subject Author
Re: [gentoo-user] qbittorrent crashes after to many files open error mad.scientist.at.large@××××××××.com
Re: [gentoo-user] qbittorrent crashes after to many files open error Mateusz Okulus <mmokulus@×××××.com>