FAQ  •  Register  •  Login

Scanning for updated files setting appears ignored

<<

stephendhill

Serviio lover

Posts: 72

Joined: Sat Jan 30, 2010 9:59 am

Location: UK

Post Sun Apr 10, 2011 5:51 pm

Scanning for updated files setting appears ignored

I am using Serviio 0.5.2. I have been noticing very high CPU usage most of the time. I have "Search for updates of currently shared files" deselected, but when I look in the log I still see this:

  Code:
  [LibraryUpdatesCheckerThread] Started looking for updates to currently shared files


which seems very odd and would account for why I see "java" at the top of my process cpu usage list. I have an enormous amount of photos, which I assume it is scanning constantly?

P.S. Is the any chance of serviio being updated to support file system notification of changes (inotify)? This is supported by mediatomb, and would avoid the need for polling for changes to the filesystem.
Avid Serviio user
Pure Flow One | Samsung LE40B650 | Samsung UE40F6320 | Sony PS3 | Ubuntu 14.04
<<

Cerberus

User avatar

DLNA master

Posts: 4114

Joined: Sun Jan 02, 2011 5:20 pm

Location: Reading, UK

Post Sun Apr 10, 2011 7:24 pm

Re: Scanning for updated files setting appears ignored

stephendhill wrote:I am using Serviio 0.5.2. I have been noticing very high CPU usage most of the time. I have "Search for updates of currently shared files" deselected, but when I look in the log I still see this:

  Code:
  [LibraryUpdatesCheckerThread] Started looking for updates to currently shared files


which seems very odd and would account for why I see "java" at the top of my process cpu usage list. I have an enormous amount of photos, which I assume it is scanning constantly?

P.S. Is the any chance of serviio being updated to support file system notification of changes (inotify)? This is supported by mediatomb, and would avoid the need for polling for changes to the filesystem.


viewtopic.php?f=5&t=1791

and no we dont have access to low level process's currently
Phil Bennett
Beta Tester Group
Wiki | FAQ

Samsung LE40C750 LCD | Samsung BD-C5900 | Sony PS3 | Windows 7 |
HowTo: Provide supported formats of a device HowTo: Record a new ticket on Bitbucket
HowTo: Provide details of a video file that doesn't play HowTo: Turn on detailed logging
<<

stephendhill

Serviio lover

Posts: 72

Joined: Sat Jan 30, 2010 9:59 am

Location: UK

Post Sun Apr 10, 2011 7:44 pm

Re: Scanning for updated files setting appears ignored

At high cpu usage the fan on my server machine gets very noisy (and it also chews a lot of power).
Avid Serviio user
Pure Flow One | Samsung LE40B650 | Samsung UE40F6320 | Sony PS3 | Ubuntu 14.04
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17212

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Sun Apr 10, 2011 8:23 pm

Re: Scanning for updated files setting appears ignored

The high CPU can also be caused by searching for new or removed files. If you have a fairly stable folder (ie no additions/removals of files), you can uncheck the circular arrow checkbox for those folders to disable searching for new files.

iNotify would be nice, but I fear that it wont work on all possible OSes where Serviio otherwise could run. I am hoping for a soonish releqse of Java 7 which brings this functionality.
<<

stephendhill

Serviio lover

Posts: 72

Joined: Sat Jan 30, 2010 9:59 am

Location: UK

Post Fri Jul 29, 2011 6:49 am

Re: Scanning for updated files setting appears ignored

Java 7 has been released with support for IO notification wrapped us as the WatchService API!

http://java.sun.com/developer/technical ... ase/nio/#6
Avid Serviio user
Pure Flow One | Samsung LE40B650 | Samsung UE40F6320 | Sony PS3 | Ubuntu 14.04
<<

Cerberus

User avatar

DLNA master

Posts: 4114

Joined: Sun Jan 02, 2011 5:20 pm

Location: Reading, UK

Post Fri Jul 29, 2011 10:22 am

Re: Scanning for updated files setting appears ignored

stephendhill wrote:Java 7 has been released with support for IO notification wrapped us as the WatchService API!

http://java.sun.com/developer/technical ... ase/nio/#6


yep but current version of serviio WILL NOT run of java 1.7, and with ZIP on his holiday im unsure if 0.6 will work either.
Phil Bennett
Beta Tester Group
Wiki | FAQ

Samsung LE40C750 LCD | Samsung BD-C5900 | Sony PS3 | Windows 7 |
HowTo: Provide supported formats of a device HowTo: Record a new ticket on Bitbucket
HowTo: Provide details of a video file that doesn't play HowTo: Turn on detailed logging
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17212

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Sat Jul 30, 2011 2:46 am

Re: Scanning for updated files setting appears ignored

I'll want to have 0.6 working with Java 1.7 but this IO feature won't be implemented for some time. One of the reasons being a lot of NAS installations don't have Java 7 yet and probably won't have for some time. Once it's more widespread then I can look at making Serviio Java 7 only.
<<

ddfs

Serviio newbie

Posts: 17

Joined: Sat Oct 29, 2011 4:50 pm

Post Tue Nov 22, 2011 12:48 pm

Re: Scanning for updated files setting appears ignored

Any updates here?
I have Serviio working on Synology NAS with Java 7 installed. Maybe it's time? :)
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17212

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Tue Nov 22, 2011 1:56 pm

Re: Scanning for updated files setting appears ignored

Java 7 is not ready for Mac yet, let alone some of the smaller linux (nas) distros
<<

Cerberus

User avatar

DLNA master

Posts: 4114

Joined: Sun Jan 02, 2011 5:20 pm

Location: Reading, UK

Post Tue Nov 22, 2011 7:54 pm

Re: Scanning for updated files setting appears ignored

Phil Bennett
Beta Tester Group
Wiki | FAQ

Samsung LE40C750 LCD | Samsung BD-C5900 | Sony PS3 | Windows 7 |
HowTo: Provide supported formats of a device HowTo: Record a new ticket on Bitbucket
HowTo: Provide details of a video file that doesn't play HowTo: Turn on detailed logging
<<

manonmoon

User avatar

Serviio newbie

Posts: 10

Joined: Sat Aug 06, 2011 2:40 pm

Location: Augsburg, Germany

Post Fri Jan 13, 2012 8:50 pm

Re: Scanning for updated files setting appears ignored

I think I found a way that enables Serviio to work with inotify with utilizing the incron deamon:

I created a script
  Code:
#!/bin/bash
        #Initiate Library Refresh vi Rest API
        curl -X POST "http://192.168.178.21/rest/action" -H "Content-Type: text/xml" -d "<action><name>forceLibraryRefresh</name></action>" &> /dev/null
       
        #Incron does not support recursive inotify so we have to create a config file including all directories on our own
        find /pathtofolder/Video -type d -print0 | xargs -0 -I{} echo "{} IN_CREATE,IN_MOVED_TO,IN_MOVED_FROM,IN_MOVE_SELF,IN_MODIFY,IN_DELETE_SELF,IN_DELETE /pathtothisscript/thisscript" > /etc/incron.d/serviio.conf
        find /pathtofolder/Audio -type d -print0 | xargs -0 -I{} echo "{} IN_CREATE,IN_MOVED_TO,IN_MOVED_FROM,IN_MOVE_SELF,IN_MODIFY,IN_DELETE_SELF,IN_DELETE /pathtothisscript/thisscript" >> /etc/incron.d/serviio.conf
        ;;



This works absolutley great on my Ubuntu 10.04 Server. Nevertheless updating big libraries takes extremly long thus I would recommend to add support for parameters to the forceLibraryRferesh Action that allows us to specify which folder to update.
Last edited by manonmoon on Sat Jan 14, 2012 12:45 pm, edited 1 time in total.
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17212

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Fri Jan 13, 2012 11:11 pm

Re: Scanning for updated files setting appears ignored

All this will come at some point with Java 7.
<<

manonmoon

User avatar

Serviio newbie

Posts: 10

Joined: Sat Aug 06, 2011 2:40 pm

Location: Augsburg, Germany

Post Sat Jan 14, 2012 9:15 am

Library Refresh triggered by inotify

Hi Zip,

I completley understand this. I just wanted to provide a workaround till Java 7 and the support is integrated in Serviio.
Also for those who are interested, I slightly modified the script since it did not scan directory names with blanks.

  Code:
#!/bin/bash
        #Directories to watch separated by blanks
        WATCH="dir1 dir2 dir3"
   
      #Initiate Library Refresh via Rest API
        curl -X POST "http://<ServiioIP>/rest/action" -H "Content-Type: text/xml" -d "<action><name>forceLibraryRefresh</name></action>" &> /dev/null
 
       #Incron does not support recursive inotify so we have to create a config file including all directories on our own
        cat /dev/null > /etc/incron.d/serviio.conf
        while read N; do
          DIR=$(echo $N | sed 's/\ /\\\ /g')
          echo $DIR "IN_CREATE,IN_MOVED_TO,IN_MOVED_FROM,IN_MOVE_SELF,IN_MODIFY,IN_DELETE_SELF,IN_DELETE <pathtothisscript/thisscript>" >> /etc/incron.d/serviio.conf
        done < <(find $WATCH -type d)


Also make sure that you have installed the correct packages. For Ubuntu 10.04:
  Code:
  sudo apt-get install curl incron


I hope some may find this useful.
Last edited by manonmoon on Sat Jan 14, 2012 12:45 pm, edited 1 time in total.
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17212

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Sat Jan 14, 2012 11:58 am

Re: Scanning for updated files setting appears ignored

good job. My previous comment was just to clarify it's coming and I won't be making a change in the API for now.
<<

manonmoon

User avatar

Serviio newbie

Posts: 10

Joined: Sat Aug 06, 2011 2:40 pm

Location: Augsburg, Germany

Post Sat Jan 14, 2012 1:45 pm

Re: Scanning for updated files setting appears ignored

Just two more questions: will Serviio get any trouble if the forceLibraryRefresh command is sent very often in a short timeframe?
Will the library refresh be restarted every time the command is received or will it just ignore new requests when a refresh is already running?
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17212

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Sat Jan 14, 2012 1:54 pm

Re: Scanning for updated files setting appears ignored

it'll restart the checking threads, thus starting from the beginning every time
<<

afn

Serviio newbie

Posts: 3

Joined: Tue Feb 07, 2012 7:13 am

Post Tue Feb 07, 2012 7:19 am

Re: Scanning for updated files setting appears ignored

zip wrote:The high CPU can also be caused by searching for new or removed files. If you have a fairly stable folder (ie no additions/removals of files), you can uncheck the circular arrow checkbox for those folders to disable searching for new files.

iNotify would be nice, but I fear that it wont work on all possible OSes where Serviio otherwise could run. I am hoping for a soonish releqse of Java 7 which brings this functionality.


There's actually a library called jnotify which wraps various OS-specific notification services in a nice Java API. You should consider this as a stop-gap until Java 7 is widely adopted...

Best,
Tony
<<

afn

Serviio newbie

Posts: 3

Joined: Tue Feb 07, 2012 7:13 am

Post Tue Feb 07, 2012 7:26 am

Re: Scanning for updated files setting appears ignored

afn wrote:There's actually a library called jnotify which wraps various OS-specific notification services in a nice Java API. You should consider this as a stop-gap until Java 7 is widely adopted...

Best,
Tony


Oops, sorry -- I just saw #141 and #385.
<<

Gonzakpo

Serviio newbie

Posts: 3

Joined: Sat Aug 04, 2012 9:29 pm

Post Sat Aug 04, 2012 9:30 pm

Re: Scanning for updated files setting appears ignored

Hi. Sorry to bump this again. I just wanted to know if there are any news about Java 7 and using inotify.

Thanks for all your GREAT work! I love it!
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17212

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Sun Aug 05, 2012 5:26 pm

Re: Scanning for updated files setting appears ignored

No, will be fixed as a part of this ticket: https://bitbucket.org/xnejp03/serviio/i ... ations-was
Next

Return to Serviio Support & Help

Who is online

Users browsing this forum: No registered users and 46 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.