Fedora / Linuxで「開いたファイル/ウォッチャーが多すぎます」

Fedora / Linuxで「開いたファイル/ウォッチャーが多すぎます」

Fedora 31を搭載した「ベアメタル」マシンがあります。

VSCodeリモートを使用している場合、1〜2時間ごとにコマンドを実行またはtail -f待つjournalctlことはできませんpodman。 (VSCode端末とSSH)

この問題を解決するために、(一時的に)vscodeサーバーをシャットダウンできます。 vscodeサーバーからfdsが漏洩しているようですが、理由が見つかりません。

Googleで見つかったすべての記事に従いましたが、この問題を解決できませんでした。

sysctl fs.file-nr:

fs.file-nr = 10512      0       2000000

このコマンドは次のとおりです。https://stackoverflow.com/questions/21752067/counting-open-files-per-process/21752125#21752125

194 fds (PID = 4313), command: /usr/libexec/mysqld --basedir=/usr
141 fds (PID = 1), command: /usr/lib/systemd/systemd --switched-root --system --deserialize 29
119 fds (PID = 3448), command: /usr/bin/qbittorrent --profile=/opt
90 fds (PID = 18100), command: /usr/sbin/smbd --foreground --no-process-group
72 fds (PID = 1180), command: /usr/lib/systemd/systemd-journald
57 fds (PID = 8781), command: /usr/sbin/smbd --foreground --no-process-group
52 fds (PID = 3976), command: /usr/lib/systemd/systemd
47 fds (PID = 3785), command: /usr/bin/mongod -f /etc/mongod.conf
43 fds (PID = 1758), command: dbus-broker --log 4 --controller 9 --machine-id 48d17ca8e2184a66b9043781fdc8f037 --max-bytes 536870912 --max-fds 4096 --max-matches 16384 --audit
40 fds (PID = 1766096), command: /root/.vscode-server/bin/26076a4de974ead31f97692a0d32f90d735645c0/node /root/.vscode-server/bin/26076a4de974ead31f97692a0d32f90d735645c0/out/vs/server/main.js --host=127.0.0.1 --enable-remote-auto-shutdown --port=0

ulimit -n

500000

lsof | awk '{print $9}' | sort | uniq | wc -l

2003

そしてメモリは十分に大きいです。 free -g

              total        used        free      shared  buff/cache   available
Mem:             59           8           6           0          44          50
Swap:            63           0          63

vscodeサーバーをシャットダウンした後:
sysctl fs.file-nr

fs.file-nr = 10320      0       2000000

開いているファイルの総数が、一部の高負荷サーバーと比較して「小さい」数であることがわかります。
vscodeサーバーは40個のfdのみを使用しましたが、私が終了した後にfile-nrが200個以上減少しました。可能ですか?

私はこのrootユーザーを使用しており、SELinuxを無効にしました。リソース使用量を制限するために他にできる方法はありますか?

ベストアンサー1

おすすめ記事