Page 1 of 1

Serviio has tens of thousands of files open

PostPosted: Mon Jun 19, 2017 12:10 am
by egrivel
Hi

When I do a "lsof" on my system (OpenSUSE 42) and look for serviio's process ID, I find that the serviio process has an enormous number of files open. Right now, less than ten minutes after a fresh restart of the system, is lists 42525 open files. Is this normal? My library contains 4600 music file and 1268 video files (according to the console), and the files listed aren't media files. They are almost all .jar and .dat files.

The number of open files seems excessive, but I'm really concerned because after a while serviio crashes with the following error:

  Code:
java.lang.RuntimeException: java.io.IOException: User limit of inotify instances reached or too many open files
   at org.serviio.library.local.indexing.watching.FileDeltaWatcher.instantiateService(FileDeltaWatcher.java:206)
   at org.serviio.library.local.indexing.watching.FileDeltaWatcher.<init>(FileDeltaWatcher.java:121)
   at org.serviio.library.local.indexing.LibraryDeltaScanner.instantiateWatcher(LibraryDeltaScanner.java:148)
   at org.serviio.library.local.indexing.LibraryDeltaScanner.<init>(LibraryDeltaScanner.java:56)
   at org.serviio.library.local.indexing.LocalLibraryManager.getInstance(LocalLibraryManager.java:90)
   at org.serviio.MediaServer.main(MediaServer.java:167)
Caused by: java.io.IOException: User limit of inotify instances reached or too many open files
   at sun.nio.fs.LinuxWatchService.<init>(LinuxWatchService.java:64)
   at sun.nio.fs.LinuxFileSystem.newWatchService(LinuxFileSystem.java:47)
   at org.serviio.library.local.indexing.watching.FileDeltaWatcher.instantiateService(FileDeltaWatcher.java:202)
   ... 5 more


Note that the "maximum number of files" on my system is set at 1.6 million, which should really be more than enough for anything.

Any help would be appreciated.

Re: Serviio has tens of thousands of files open

PostPosted: Mon Jun 19, 2017 10:33 am
by zip
HI,

that's weird. It should run inotify on your shared folders only. Do you have maybe some soft links in the shared folders? Or are you not sharing a whole root ?

Re: Serviio has tens of thousands of files open

PostPosted: Tue Jun 20, 2017 1:30 am
by egrivel
It is not the data (media) files that are reported as open. Strangely, it is the .jar file and other of serviio's own files. For instance, the command

  Code:
lsof | grep serviio-web-console.jar


returns 422 lines all looking like this:

  Code:
java       8716  8910       eric   50r      REG               0,46  1987100    2606675 /mnt/washington/d1/serviio-1.8.0/lib/serviio-web-console.jar
java       8716  8911       eric  mem       REG               0,46  1987100    2606675 /mnt/washington/d1/serviio-1.8.0/lib/serviio-web-console.jar
java       8716  8911       eric   50r      REG               0,46  1987100    2606675 /mnt/washington/d1/serviio-1.8.0/lib/serviio-web-console.jar
java       8716  8912       eric  mem       REG               0,46  1987100    2606675 /mnt/washington/d1/serviio-1.8.0/lib/serviio-web-console.jar
java       8716  8912       eric   50r      REG               0,46  1987100    2606675 /mnt/washington/d1/serviio-1.8.0/lib/serviio-web-console.jar
java       8716  8914       eric  mem       REG               0,46  1987100    2606675 /mnt/washington/d1/serviio-1.8.0/lib/serviio-web-console.jar
java       8716  8914       eric   50r      REG               0,46  1987100    2606675 /mnt/washington/d1/serviio-1.8.0/lib/serviio-web-console.jar
java       8716  8915       eric  mem       REG               0,46  1987100    2606675 /mnt/washington/d1/serviio-1.8.0/lib/serviio-web-console.jar
java       8716  8915       eric   50r      REG               0,46  1987100    2606675 /mnt/washington/d1/serviio-1.8.0/lib/serviio-web-console.jar


It is almost as if serviio loads itself hundreds of times. Similar results for many other .jar files. It seems that the .dat files in the database are each opened 210 times.