Page 1 of 1

apache stalls solved - hopefully on ubu 9.04/1.24.2

Posted: Tue Jan 12, 2010 12:02 am
by jfkastner
on ubu 9.04 with 1.24.2 my apache stalled after 5-15 min, here's what i did to make it better:

i belive in stream.php are a few typos - there were 's.sock' and 'w.sock' files created - changed all two lines to 's.sock'

$locSockFile = ZM_PATH_SOCKS.'/zms-'.sprintf("%06d",$_REQUEST['connkey']).'s.sock';

also in this line was a 'k' too much (it said locksockfile before) - but that's just for the error msg

ajaxError( "socket_bind( $locSockFile ) failed: ".socket_strerror(socket_last_error()) );

another idea was to change the retry, so it looks every 0.2 sec for the file

$max_socket_tries = 10;
while ( !file_exists($remSockFile) && $max_socket_tries-- ) //sometimes we are too fast for our own good, if it hasn't been setup yet give it a second.
usleep(200000);

guess that was from PHP4 or earlier when usleep wasn't there

everything looks like it's working now, quicker and smoother! i think that my P4-1.8-north is fast enough to check that often (11 IP cams BLC01)

another idea was the to set the ulimit for nofiles to 4096 globally:

i've set /etc/security/limits.conf to

* - nofile 4096
root - nofile 4096
www-data - nofile 4096

hope that helps someone ... long time that i've done scripts though ...

EDIT

that s.sock change broke the progress bars ... but the timeout works nicely

biggest impact gotta be the files limit, almost everything runs as root or www-data

Posted: Wed Jan 13, 2010 11:34 am
by Flav
s.sock change broke the progress bars
Hello i think this change the possibility to generate video from events windows and remov displaying events on the stream monitor windows[/quote]

Posted: Mon Nov 15, 2010 4:39 pm
by jebba
Changing the w.sock to s.sock made all the difference in the world for me. It doesn't seem like a 100% correct fix, but it got my system going well. :)