Bugzilla – Bug 17498
AutoRescan causes server outage
Last modified: 2011-09-02 04:12:10 UTC
I'm running SBS 7.6.1 r33148 on Fedora 14. Three times per day the server performs an AutoRescan. While the scan takes place, the SBS does not respond. The SqueezeBox display "connection lost, retry...". In my case this lasts about 20 minutes. In contrast, during the daily scheduled rescan, SBS stays responsive. Difference is that the latter is performed by the scanner program while the former is performed by the server itself. Q1: Why the AUtoRescan? Q2: How to avoid the server outage?
While the server is scanning it consumes 99% of CPU. No excessive memory usage.
Well, I found out some things... First of all, SBS 7.6 wants to track changes using inotify for directories *AND* files. In my particular case I had to raise /proc/sys/fs/inotify/max_user_watches from 8,196 (default) to a value around 50,000 !!! But my main problem is that the file hierarchy that SBS uses is a symlinked copy of my actual music collection. Three times per day I throw away the symlinks and recreate the file hierarchy. As a result SBS instantaneously starts processing thousands and thousands of inotify requests, bringing the server down to its knees. Music stops playing and the SB looses its connection to the server. This can take up to 30 minutes! I guess noone else is having this problem since it depends on the way I have my server setup. I disabled autorescan in the server configuration and all seems to be going well now. Nevertheless I think that SBS should not handle inotify requests in its main thread.