apache stalls solved - hopefully on ubu 9.04/1.24.2

If you've made a patch to quick fix a bug or to add a new feature not yet in the main tree then post it here so others can try it out.
Post Reply
jfkastner
Posts: 74
Joined: Wed Jun 17, 2009 11:52 pm

apache stalls solved - hopefully on ubu 9.04/1.24.2

Post 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
Flav
Posts: 38
Joined: Tue Jan 12, 2010 2:26 pm

Post 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]
jebba
Posts: 5
Joined: Mon May 17, 2010 6:16 am
Location: Redstone Canyon, Colorado

Post 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. :)
Post Reply