0

is there any possibility to track number of open files, which are used while Kamailio handle new calls? So far, I tried to use script in bash and start the script using watch command

FILES=$(ls -l '/proc/'$(pidof kamailio)'/fd' | wc -l)
echo $FILES >> FILES.txt

I got this kind of result:

ls: cannot access '1809' : No such file or directory
ls: cannot access '1808' : No such file or directory
ls: cannot access '1807' : No such file or directory
.
.
.
ls: cannot access '1795/fd' : No such file or directory
John Kugelman
  • 349,597
  • 67
  • 533
  • 578
RAJJJA
  • 25
  • 6

1 Answers1

0

Since kamailio in most systems running under kamailio user, you can do something like this:

lsof -u kamailio | wc -l
arheops
  • 15,544
  • 1
  • 21
  • 27
  • Thanks for help. The command works and I don´t get error message anymore, but when I have increasing number of simultaneous call, result of command is still same – RAJJJA Apr 24 '21 at 13:39
  • Why you think increase number of calls increase files handles? It increase sockets. See netstat -a – arheops Apr 24 '21 at 21:29
  • A socket is a file handle. The question is why a new call should consume a file handle/socket. Hint: it doesn't have to. – Matthias Urlichs Feb 16 '22 at 15:16
  • Thats how sockets originized in linux/unix, sorry. – arheops Feb 16 '22 at 19:29