Maxopenfile reached & machine hangs zm problem ?

Forum for questions and support relating to the 1.24.x releases only.
fc
Posts: 10
Joined: Fri Feb 20, 2009 12:23 am

Maxopenfile reached & machine hangs zm problem ?

Post by fc »

Hi to all
I'm using archlinux from the livecd I'm now using 4 cams:
1-Gadspot (mjpeg)
2- Desecurity cam (rtsp)
3- icamview ptz (with icamview proxy)
4- Icamview cam (icamview proxy)

Wha is happening is that after a few hours of working my machine get max open file reached 58700.. and this what is really configured in /proc/sys/fs/file-max.
I tried to increase this but on reboot i get the same number on file-max.
The issue is that why do i have 58700 open is this an apache bug ?
because if i do a lsof i don't have 58700 file opened....
any clue ??

thanks
Last edited by fc on Fri Apr 10, 2009 2:25 pm, edited 1 time in total.
fc
Posts: 10
Joined: Fri Feb 20, 2009 12:23 am

Post by fc »

somthing to do with ZM..
after 10 hours uptime i have this
"
[root@zmhost shm]# cat /proc/sys/fs/file-nr
40704 0 50837
"
then i do this
[root@zmhost shm]# /etc/rc.d/zm stop
:: Stopping ZoneMinder [DONE]
[root@zmhost shm]# cat /proc/sys/fs/file-nr
896 0 50837

and my open files come down to 896 ???

why ? any1 knows ?

thanks
vpetersson
Posts: 9
Joined: Tue Mar 24, 2009 6:11 am

Post by vpetersson »

fc,

It could be the FD_SETSIZE in one of the dependencies (set when compiling). This flag also controls the maximum files. But I've gone crazy in the past trying to hunt down similar problems. Take a look at all the sysctl values tho, you're likely to find something there too (i.e. maxfiles and maxfilesproc).
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

There should be no reason why ZM should have so many files open. Nor should apache have any ZM files open unless you are actively using the interface.

Perhaps you could experiment by seeing what the number does if you don't use the web interface for instance. Also if you switch off certain monitors in case it is an issue withthe proxy for example.
Phil
fc
Posts: 10
Joined: Fri Feb 20, 2009 12:23 am

Post by fc »

i don't know where are the open files, because if i do "lsof" they don't apear...
This issue occurs even without any interface interaction...
Until i found whats up i scheduled zm restart every night at 4am...

Any clue where to check the open files ? something to with /dev/shm ?
zoneminder wrote:There should be no reason why ZM should have so many files open. Nor should apache have any ZM files open unless you are actively using the interface.

Perhaps you could experiment by seeing what the number does if you don't use the web interface for instance. Also if you switch off certain monitors in case it is an issue withthe proxy for example.
delian
Posts: 1
Joined: Fri May 01, 2009 8:07 am

Post by delian »

I've the same problem.. I'm using archlinux.
I've tried to increase the open file limit to an higher value ( open files (-n) 10240 ) but still the same problem..


Any other hint?
rsdvd
Posts: 33
Joined: Wed Dec 21, 2005 10:20 am

Post by rsdvd »

Do you leave the Montage view open?

I have a similar problem in CentOS, if I leave the Montage view open in a browser it will generate hundreds of httpd processes each with files open......this eventually hits either the apache maximum if I set ti low enough of hangs when it runs out of file handles.

I am not sure what causes this, but I am beging to believe it might be a bug in the montage code.
User avatar
henriquejf
Posts: 77
Joined: Tue Feb 10, 2009 12:01 pm
Location: Brazil

related topics

Post by henriquejf »

Maybe you can find these usefull posts regarding the same simptoms,

* apache hanging (this topic)
** maxopenfile reached:: http://www.zoneminder.com/forums/viewtopic.php?t=13486

** apache not responding:: http://www.zoneminder.com/forums/viewtopic.php?t=13322

** Apache instances/responsiveness issue...solved:: http://www.zoneminder.com/forums/viewto ... c&start=15

I modestly think that there should be a way to "elegantly" close the montage view, so that related zms childs would close for sure; I think my problem is related to yours because after letting the montage open for more than 2 minutes gives me problems; i am actively trying to have that solved, but still no success;
-----------------------
Henrique Barbosa
Consultant
Juiz de Fora, MG - Brazil
User avatar
henriquejf
Posts: 77
Joined: Tue Feb 10, 2009 12:01 pm
Location: Brazil

duplicated topics

Post by henriquejf »

In an effort to solve, or even organize related problems, i am asking users experiencing **APACHE HANGS** to double check what has been tried before by other users, so we don´t loose our time and get things working as expected;

I am not even sure that it is a ZM bug, but i am sure that many people have to restart apache from time to time, just as me; One user found it useful to restart apache as a cron job every x minutes, another user proposed to use http://jzmconsole.securitykit.net/ as a workaround for the problem when it happens in the montage view, but i am sure that we´ll have that fixed soon by the community, so we don´t have to give up and try the mentioned workarounds;


apache hanging problems - related, duplicated (or not) topics
==============================================================


** Maxopenfile reached & machine hangs zm problem ?
http://www.zoneminder.com/forums/viewtopic.php?t=13486

** apache not responding
http://www.zoneminder.com/forums/viewtopic.php?t=13322

** Apache instances/responsiveness issue...solved(?)
http://www.zoneminder.com/forums/viewto ... c&start=15

** Zoneminder UNSTABLE & HANGS, needs frequent restarting
http://www.zoneminder.com/forums/viewto ... 1196#51196

** hundreds of httpd processes
http://www.zoneminder.com/forums/viewtopic.php?t=13588


If some experienced programmer could give us a light, it would be so kind !!
-----------------------
Henrique Barbosa
Consultant
Juiz de Fora, MG - Brazil
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

This should be patched already in SVN, are you running the latest version?
User avatar
henriquejf
Posts: 77
Joined: Tue Feb 10, 2009 12:01 pm
Location: Brazil

Post by henriquejf »

I am currently using 1.24.1 SVN as of april 14th, 2009;

(I have searched into /usr/src/zm to get the exact svn number I used but i wasnt able /didnt find out how even searching the web);

anyway, ill try the ubuntu guide available on the wiki once again, use the newer SVN and make my prays; iĺl be advising what i got by tomorrow;

I knew that when this problem started to get popular a big chief like you would come and help us poor people; TKS so much for your and the community efforts !!!
-----------------------
Henrique Barbosa
Consultant
Juiz de Fora, MG - Brazil
mitch
Posts: 169
Joined: Thu Apr 30, 2009 4:18 am

Post by mitch »

ive released an updated version of my patch which may solve some of this issue it is at:
http://www.zoneminder.com/forums/viewto ... highlight=

If you just want the changes that could make apache behave better see the shorter patch at:
http://mitchcapper.com/zm_streams.patch
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

It's not so much of how much a problem it is as much as the time available to work on it. :evil:
User avatar
henriquejf
Posts: 77
Joined: Tue Feb 10, 2009 12:01 pm
Location: Brazil

Post by henriquejf »

that is for sure !

Tks once again !
-----------------------
Henrique Barbosa
Consultant
Juiz de Fora, MG - Brazil
MrEvoMan
Posts: 55
Joined: Thu Apr 23, 2009 1:25 am

Post by MrEvoMan »

mitch wrote:ive released an updated version of my patch which may solve some of this issue it is at:
http://www.zoneminder.com/forums/viewto ... highlight=

If you just want the changes that could make apache behave better see the shorter patch at:
http://mitchcapper.com/zm_streams.patch
Can you inform us non-developers how to apply a patch like this?

Thanks!
Locked