A lot of IPcam - capability of PC/CPU - strange block/halt

Forum for questions and support relating to the 1.24.x releases only.
Locked
pp1981
Posts: 17
Joined: Sun Jul 10, 2011 3:29 pm

A lot of IPcam - capability of PC/CPU - strange block/halt

Post by pp1981 »

Hello,

I have installed 5 IPcam (FOSCAM) that hasn't problem of communication when I connect that with their internal IP: for example 192.168.1.xx:yyyy (frames are very flowing).

Passing through ZM with all IPcam in "modect" the live view is slower.
I try to gradually disable (none) each IPcam: the situation became better and is right with one, two or three IPcam in modect.

The big problem is the follow:
when I view an event recorded with "modect" the first 10 (around) frames are ok, than there is a jump of 3/4 seconds followed by a halt/block and so the last correct frames...
(I FOUND THAT PROBLEM AFTER CHANGE OF BUFFER IMAGE.... default value was 1000... I change it in 100... but the problem persists after re-change in 1000 and only with all the five or four IPcam in modect. With three the problem vanish).

I try a lot of possible combinations: I observe that the problem is only with the cam connected by LAN (high FPS) and not with cam connected by Wi-fi(lower FPS)...
So I think that my PC cannot support too much datas....

Any ideas?!?!!??

Thanks
Flasheart
Posts: 342
Joined: Thu Jul 06, 2006 2:27 pm

Re: A lot of IPcam - capability of PC/CPU - strange block/ha

Post by Flasheart »

What is your computer specification and current load? (Run uptime, or top for a live view)

Munin will show a good range of graphs which will help find problems.
pp1981
Posts: 17
Joined: Sun Jul 10, 2011 3:29 pm

Re: A lot of IPcam - capability of PC/CPU - strange block/ha

Post by pp1981 »

This is top result with all IPcam running in modect:

Code: Select all

top - 09:26:15 up 21:01,  2 users,  load average: 11.36, 10.05, 8.02
Tasks: 168 total,  11 running, 156 sleeping,   0 stopped,   1 zombie
Cpu(s): 91.4%us,  4.3%sy,  0.0%ni,  0.0%id,  0.0%wa,  0.0%hi,  4.3%si,  0.0%st
Mem:   1990004k total,  1879032k used,   110972k free,   200512k buffers
Swap:  2027516k total,   145728k used,  1881788k free,   820344k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                          
18256 www-data  20   0  237m  45m  38m R  9.6  2.3   0:34.82 zmc                                                              
 5617 www-data  20   0  235m  44m  38m R  9.2  2.3  59:11.46 zma                                                              
18260 www-data  20   0  234m  42m  38m R  9.2  2.2   0:34.73 zma                                                              
 5615 www-data  20   0  241m  49m  38m R  8.9  2.5  58:33.04 zmc                                                              
 5627 www-data  20   0  254m  63m  38m R  8.9  3.2  50:14.55 zmc                                                              
 5629 www-data  20   0  236m  45m  38m R  8.9  2.3  59:03.11 zma                                                              
18206 www-data  20   0  237m  45m  38m R  8.9  2.3   0:41.35 zmc                                                              
18209 www-data  20   0  235m  43m  38m R  8.9  2.2   0:42.98 zma                                                              
18232 www-data  20   0  237m  45m  38m R  8.9  2.3   0:39.61 zmc                                                              
18236 www-data  20   0  235m  44m  38m R  8.9  2.3   0:39.12 zma                                                              
 1245 root      20   0  413m 107m 7012 S  2.3  5.5  10:05.05 Xorg                                                             
17196 paolo     20   0 42896  13m 9776 S  2.3  0.7   0:23.38 npviewer.bin                                                     
 1562 paolo     20   0  298m 9052 5748 S  1.6  0.5  16:32.52 sensors-applet                                                   
16060 paolo     20   0  783m 149m  38m S  1.6  7.7   2:30.44 firefox-bin                                                      
Two of five IPcam are under D-link LAN switch.

In attach you can find the HTML file result of computer specification with the program "system profiler":
CPU: Intel(R) Celeron(R) 3.06GHz
Attachments
hardinfo_report.html.tar.gz
(8.85 KiB) Downloaded 223 times
pp1981
Posts: 17
Joined: Sun Jul 10, 2011 3:29 pm

Re: A lot of IPcam - capability of PC/CPU - strange block/ha

Post by pp1981 »

For clarification:
with one IPcam in modect: current CPU 50-60% around;
with two IPcam in modect: current CPU 90% around;
with three or more IPcam in modect: current CPU >100% around.

The problems with record are with three or more cams.
I'm convinced that it's a CPU problem... in your opinion? It could be a LAN problem too? If I connect all IPcam to the D-link switch I will have too much datas that my CPU cannot support... if I change computer can I improve that?

Thanks

P.S.: I tried to use munin but it is in background and I cannot use it (sorry) :? . How can I do it?
Zap
Posts: 1
Joined: Tue Aug 23, 2011 12:33 pm

Re: A lot of IPcam - capability of PC/CPU - strange block/ha

Post by Zap »

pp1981,

I ran into something very similar running 9 Foscam F18905w's with Ubuntu 11.04 and zm
1.24.2 on a Zotac D525, 4gig of ram.

Looking at top, your using up almost all memory, doing a lot of swaping alot of cache going
on.
I loaded up Webminstat so I could graph it.

I think the problem is with Apache its self, I made a few changes to the apache2.conf file
and the problem seems to have gone away.

Code: Select all

# prefork MPM
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# MaxClients: maximum number of server processes allowed to start
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_prefork_module>
    StartServers          5
    MinSpareServers       0
    MaxSpareServers       2
    MaxClients           20
    MaxRequestsPerChild  100
</IfModule>

# worker MPM
# StartServers: initial number of server processes to start
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadLimit: ThreadsPerChild can be changed to this maximum value during a
#              graceful restart. ThreadLimit can only be changed by stopping
#              and starting Apache.
# ThreadsPerChild: constant number of worker threads in each server process
# MaxClients: maximum number of simultaneous client connections
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_worker_module>
    StartServers         5
    MinSpareThreads      25
    MaxSpareThreads      75 
    ThreadLimit          64
    ThreadsPerChild      25
    MaxClients           20
    MaxRequestsPerChild  100
</IfModule>

# event MPM
# StartServers: initial number of server processes to start
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadsPerChild: constant number of worker threads in each server process
# MaxClients: maximum number of simultaneous client connections
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_event_module>
    StartServers         5
    MinSpareThreads      25
    MaxSpareThreads      75 
    ThreadLimit          64
    ThreadsPerChild      25
    MaxClients           20
    MaxRequestsPerChild  100
</IfModule>
Buffer for my cams.

Image Buffer Size: 20
Warmup Frames: 5
PreEvent Image Count: 5
PostEvent Image Count: 5
Stream Reply Image Buffer: 1000
Alarm Frame Count: 1

Cams set at capture pixels of 320x240 will do 30 fps during the day up to 70% cpu, 15 fps 35% cpu at night, taking up to 1 gig of ram.

HTH
Last edited by Zap on Tue Aug 23, 2011 3:49 pm, edited 1 time in total.
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Re: A lot of IPcam - capability of PC/CPU - strange block/ha

Post by jameswilson »

OP your system is overloaded. Try reducing the framerate.
James Wilson

Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
pp1981
Posts: 17
Joined: Sun Jul 10, 2011 3:29 pm

Re: A lot of IPcam - capability of PC/CPU - strange block/ha

Post by pp1981 »

Absolutly cool Zap,

I tried to change apache2.config and firefox became speedier but I don't think that it cause the solution of the problem...

Changing the resolution too the problems expires complitly!

Thank you
Bye
Locked