Page 1 of 1

MiniDLNA log filling disk

PostPosted: Tue Nov 19, 2013 11:01 am
by rafesl
I've had a problem with disk space disappearing for a while that I've just tracked down.
It looks like the MiniDLNA log goes nuts.

I know I could drop in a cron to nuke the file once per hour or similar, but has anyone else had this happen to them?
The file seems to be be written at a rate of multiple MB / minute.

Rafe

---

Filesystem 1K-blocks Used Available Use% Mounted on
/dev/root 247968 174728 60440 74% /
/dev/sda2 247968 174728 60440 74% /
/dev/sda5 790540 17736 764772 2% /rw_fs
tmpfs 5000 300 4700 6% /rw_fs/tmp/usr/var
/dev/sda8 150999720 150999720 0 100% /share/1000
/dev/sdb1 488384000 374127460 114256540 77% /rw_fs/tmp/mnt/External_1
/dev/sdb1 488384000 374127460 114256540 77% /share/1000/External_1
/dev/root 198368 122328 65800 65% /lacie-boot


root@moviestore:/share/1000 # cd /share/1000/minidlna/database/
root@moviestore:/share/1000/minidlna/database # ls -la
total 56238652
drwxr-xr-t 3 root root 4096 2013-10-21 02:39 .
drwxrwxrwx 3 root root 4096 2013-10-02 01:23 ..
drwxr-xr-x 3 root root 4096 2013-10-21 02:39 art_cache
-rw-r--r-- 1 root root 8818688 2013-11-18 06:02 files.db
-rw-r--r-- 1 root root 57523294208 2013-11-20 05:09 minidlna.log


root@moviestore:/share/1000/minidlna/database # tail minidlna.log
[2013/11/18 23:19:46] minidlna.c:1294: error: accept(http): Too many open files
[2013/11/18 23:19:46] minidlna.c:1294: error: accept(http): Too many open files
[2013/11/18 23:19:46] minidlna.c:1294: error: accept(http): Too many open files
[2013/11/18 23:19:46] minidlna.c:1294: error: accept(http): Too many open files
[2013/11/18 23:19:46] minidlna.c:1294: error: accept(http): Too many open files
[2013/11/18 23:19:46] minidlna.c:1294: error: accept(http): Too many open files
[2013/11/18 23:19:46] minidlna.c:1294: error: accept(http): Too many open files
[2013/11/18 23:19:46] minidlna.c:1294: error: accept(http): Too many open files
[2013/11/18 23:19:46] minidlna.c:1294: error: accept(http): Too many open files
[2013/11/18 23:19:46] minidlna.c:1294: error: accept(http): Too many open

Re: MiniDLNA log filling disk

PostPosted: Tue Nov 19, 2013 3:27 pm
by Jocko
Hi rafesl,

it seems that minidlna reaches a system limit (max number of open file in the same time).

Currently the default system limit is 1024 (soft limit). To check that do it:
-read the pid of minidlna
Code: Select all
cat /var/run/minidlna.pid

-see how many files are opened by minidlna
Code: Select all
ls -l /proc/pid/fd
(change 'pid' by the number got previously)
So in this folder, the number of symlinks gives the number of opened files.

Then I think you must get 1023 (or 4095 hard limit).

Next step is to understand why minidlna reachs this limit (search on your dlna clients side or minidlna tries to update the database with many new files...)

Re: MiniDLNA log filling disk

PostPosted: Wed Nov 20, 2013 9:41 am
by rafesl
Thanks for that.
I'll have a look in the next few evenings and check.

Re: MiniDLNA log filling disk

PostPosted: Wed Nov 20, 2013 9:28 pm
by hardy74
I use MiniDLNA from several devices pretty heavily, and the log is about 1 MB, with data since January. So no problem here.

Re: MiniDLNA log filling disk

PostPosted: Tue Dec 17, 2013 4:36 pm
by rafesl
root@moviestore:/ # ls -l /proc/1081/fd |more
total 0
lrwx------ 1 root root 64 2013-12-19 00:43 0 -> /dev/null
lrwx------ 1 root root 64 2013-12-19 00:43 1 -> /dev/null
lrwx------ 1 root root 64 2013-12-19 00:43 10 -> socket:[241142]
lrwx------ 1 root root 64 2013-12-19 00:43 100 -> socket:[240648]
lrwx------ 1 root root 64 2013-12-19 00:43 1000 -> socket:[249788]
lrwx------ 1 root root 64 2013-12-19 00:43 1001 -> socket:[249784]
lrwx------ 1 root root 64 2013-12-19 00:43 1002 -> socket:[249801]
lrwx------ 1 root root 64 2013-12-19 00:43 1003 -> socket:[249809]
lrwx------ 1 root root 64 2013-12-19 00:43 1004 -> socket:[249805]
lrwx------ 1 root root 64 2013-12-19 00:43 1005 -> socket:[249844]
lrwx------ 1 root root 64 2013-12-19 00:43 1006 -> socket:[249852]
lrwx------ 1 root root 64 2013-12-19 00:43 1007 -> socket:[249848]


lots and lots of those "socket" files are listed.

Sorry its been a while since I checked this but family life being what it is I dont get to sort this kind of thing as much as I used.

Re: MiniDLNA log filling disk

PostPosted: Tue Dec 17, 2013 4:50 pm
by rafesl
I just applied the minidlna service control fix.

I'll see if that fixes things.

ty

Rafe

Re: MiniDLNA log filling disk

PostPosted: Fri Dec 20, 2013 10:23 am
by rafesl
I've checked the log and since applying the fix I haven't had any issue.

Thank you.

Rafe

Re: MiniDLNA log filling disk

PostPosted: Fri Dec 20, 2013 2:02 pm
by Jocko
Glad to heard this rafesl :-D

So maybe as minidlna didn't know where the pid file was saved without the patch, it didn't succeed to find its child threads and close the opened files...