brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: cat /proc/PID/limits shows the real linux limits of a running process

Linux
~/tips/tip-linux-proc-pid-limits

cat /proc/$pid/limits

Prints the resource limits that apply to one running process.

The limits in your shell and the limits of a daemon started by systemd are often different, so I check the process itself.

pid=$(pgrep -o nginx)
cat /proc/$pid/limits

The file lists the soft and hard value of every resource limit, such as Max open files and Max processes, for that exact process. This is the number that counts when you see Too many open files. If it is lower than you expected, set LimitNOFILE= in the systemd unit instead of editing a shell profile. pgrep -o picks the oldest matching process, which is normally the master.

Further reading: proc_pid_limits manual page

More Linux tips a2query -m rewrite renice -n 10 -p 4242 cat config.yml | xsel -ib xvfb-run -a your-program --some-flag dpkg --get-selections > packages.txt All Linux tips (261) All topics

Link