1

I have my rlimit_files set to 65535 yet when I run lsof -c php-fpm | wc -l I get 218k results.

How is this possible? I never noticed any big issues but I wonder if should increase it?

I even had this in my systemd already LimitNOFILE=150000, but I guess this only apply to the main pid not the children ?

1 Answer 1

3

From the documentation:

rlimit_files Set open file descriptor rlimit for the master process.

It is a per-process limit, and your lsof command counts all files for all matching processes, including memory-mapped files like shared libraries that don't count towards rlimit_files. You need to use something like lsof -a -c php-fpm -d^mem,^txt,^cwd,^rtd,^DEL.

2
  • Thanks for you command. May I ask what it does? it seems my highest value is 31k so I should be safe Commented Aug 24 at 0:24
  • 1
    The command does the same as yours, but excludes files that don't count toward rlimit_files. Commented Aug 24 at 6:51

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.