2

on our rhel server 7.6 version we have the following systemctl service

/etc/systemd/system/test-infra.service

and the value of LimitNOFILE is

systemctl show test-infra.service | grep LimitNOFILE
LimitNOFILE=65535

so I assume the number of open files is max 65535 per this service

is it possible to print the current of open files that are used by this service?

or how to show how many files this service is using?

1 Answer 1

0

If you can identify the executable run by this service (in the ExecStart= statement of the test-infra.service file), you should be able to do this using

lsof | grep executable name

possibly followed by | wc -l if you just want to count the files.

2
  • this is too slow Commented May 23, 2024 at 18:49
  • sudo lsof -c<program>, described in man lsof lists the open files of <program>. There's also the -p PID option to select by process id, and many other options. Commented Jul 6 at 14:58

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.