0

We are facing too many open files in linux server and we already increase ulimits to maximum.

I am planning to close file descriptor using gdb command and then close fd for pid which I am looking for.

Will that solve issue of too many files, we are also looking solution to fix this from application .

Can anyone suggest closing fd by using gdb will solve our problem? Please suggest.

Nilay Tiwari
  • 492
  • 5
  • 16

1 Answers1

0

When executing lsof command it giving 26k files on server.

It seems unlikely that you have 26K distinct .ttf font files on the system.

This suggests that you open the same .ttf font multiple times, or that you are leaking file descriptors.

You should definitely fix the FD leak (if there is one) -- no amount of manually closing FDs is going to let the server work -- it will simply run into the same problem after a while.

For the "open the same file many times", the usual solution is to introduce a font cache -- before opening a file, check the font cache and use data from it if it's already been opened. This may increase memory consumption, but eliminate the "open many times" problem.

Memory consumption could be managed (if necessary) by using appropriate cache expiration policy.

Employed Russian
  • 199,314
  • 34
  • 295
  • 362
  • We are doing the same, can you please suggest mean time can we use gdb close – Nilay Tiwari Mar 07 '22 at 00:25
  • Now this issue is resolved this is because of pdfbox version 2.0.4 . in that version leakage of .ttf files, this issue is solved in 2.0.12 version , we used 2.0.25 . It solve this issue. we also used linux script for one day to close connection on server , gdb $pid and then p close(fd) – Nilay Tiwari Mar 11 '22 at 12:26