High load and just on Monitor mode... any ideas?

Forum for questions and support relating to the 1.24.x releases only.
limitlessent
Posts: 46
Joined: Wed Mar 18, 2009 8:38 am

High load and just on Monitor mode... any ideas?

Post by limitlessent »

I have a Quad Core Amd opteron 2.8ghz machine with 12gb ram to do 24 ip cameras. All 24 are in Monitor mode but my load average w/o even recording or anything is already showing 5.0+ most of the time.

This server did have 2gb and I upgraded it but haven't made any changes to zm since the upgrade... Is there something I need to do so it'll use the extra ram or what can I to do drop the load?
pki
Posts: 29
Joined: Sat Mar 06, 2010 8:59 am

Post by pki »

I think the problem is ZM have to decompress the streams from the IP cams even if you do only monitor-mode.

If you like to monitor more IP cams a simple and fast solution should be a simple html page like the montage view from zoneminder and then replace the source address of each stream direct to the IPcam.

I think this should be updated sometime later in zoneminder. The currently availible solutions for IPcam's (like koukaam ipcorder) dont decompress the stream, they dont even analyze it for motion - the cam does it.

Maybe you can limit the framerate or bandwith in the cam, this should lower the load.
SQ2LYH :-)
limitlessent
Posts: 46
Joined: Wed Mar 18, 2009 8:38 am

Post by limitlessent »

I can limit the bandwidth from each cam...
For 10fps @ 640x480.. what's the lowest I should go on bandwidth?
My options are:
4Mbps
3Mbps
2Mbps
1Mbps
768Kbps
512Kbps
256Kbps
etc...

In the cams I also have "Intra Frame Period" currently set at 1 S
What does that do?
The options for that are:
4S
3S
2S
1S
1/2S
1/4S

Would changing any of that help?
limitlessent
Posts: 46
Joined: Wed Mar 18, 2009 8:38 am

Post by limitlessent »

I've just tried switching from mpeg4 to mjpeg and that makes the load worse so I'm switching it back... Any other suggestions?
pki
Posts: 29
Joined: Sat Mar 06, 2010 8:59 am

Post by pki »

If you are using 10fps at VGA resolution, hmmm, just try it. lower to 512kb. if you see the image quality is too low you should go one step up. also you can lower the framerate if you not need 10fps. i am driving an remote cam via internet line with 128kbps only, using vga resolution and MJPEG. The quality is good, the framerate is low, only one or two frames per second. Choose MJPEG if you need better quality and lower framerate. Choose MPEG4 if you need lower quality but high framerate with low detail.
SQ2LYH :-)
pki
Posts: 29
Joined: Sat Mar 06, 2010 8:59 am

Post by pki »

The intraframe setting is only for MPEG4. It sends an full image every (4Seconds or 3Seconds and so on). Beetween the intraframes MPEG4 sends only the difference from the last frame.

To lower the load you can also try the jpeg-turbo libs. It needs some hacking around and compiling, you will find it here on the board. Best case it can lower the load by half.
SQ2LYH :-)
limitlessent
Posts: 46
Joined: Wed Mar 18, 2009 8:38 am

Post by limitlessent »

So what should have a lower load? Mpeg4 @ 10fps or mjpeg @ 5fps?
limitlessent
Posts: 46
Joined: Wed Mar 18, 2009 8:38 am

Post by limitlessent »

k.. I compiled libjpeg-turbo and replaced symlinks for libjpeg in /usr/lib to point to the libjpeg-turbo libs in /opt/libjpeg-turbo.

Right now my cams are all still in mpeg4 mode... I guess I need to switch them all back to mjpeg to see the turbo-jpeg difference?
limitlessent
Posts: 46
Joined: Wed Mar 18, 2009 8:38 am

Post by limitlessent »

Anyone?
pki
Posts: 29
Joined: Sat Mar 06, 2010 8:59 am

Post by pki »

24 IP cams is a big load for the server. Just try around. I suggest to use MJPEG - it gives better image quality and lower frame rate. Wit the turbo-lib you should be able to lower the load. If it is still to high try to lower the framerate. Of course check some other system parameters, RAM usage, swapping and so on with htop.
SQ2LYH :-)
limitlessent
Posts: 46
Joined: Wed Mar 18, 2009 8:38 am

Post by limitlessent »

Ok.. I've switched all 24 cams to mjpeg @ 5fps.
Server is a quad core amd opteron 2.8ghz w/ 12gb ram.

Using libjpeg-turbo.
With all 24 cams on mocord, my load average is ~10.00 and shouldn't be higher than 4.0 on a quad core box.

How do I determine whether my bottleneck is cpu, ram or what so I can fix it?

Or is there anything else short of lowering below 5fps that would help?
this server had 2gb ram when I installed zoneminder. I've since upgraded it to 12gb so I haven't changed anything other than just adding the ram and booting back up... Do I need to make some changes somwehere so zm will use the memory I've added?

Also... htop shows cpu usage @ approx 30% across all 4 cores.
It shows memory usage (weird to me) at 502mb out of 12288mb. it's like it's not using the extra ram....

Running free shows this:
[root@zoneminder ~]# free
total used free shared buffers cached
Mem: 12583088 11223868 1359220 0 21108 10685192
-/+ buffers/cache: 517568 12065520
Swap: 4161528 0 4161528

Current load:
12:54:29 up 17 min, 1 user, load average: 11.00, 10.50, 7.11

Any ideas?
User avatar
Normando
Posts: 219
Joined: Sun Aug 17, 2008 5:34 am
Location: Rosario - Argentina

Post by Normando »

What OS are you using?
limitlessent
Posts: 46
Joined: Wed Mar 18, 2009 8:38 am

Post by limitlessent »

CentOS5.5 32-bit. Should I load something different? I'm willing to start over if need be...
What's odd to me is, even though my load average is so high everything is still very snappy and responsive.. doesn't appear slow or sluggish at all... I think that's what gets me...
User avatar
Normando
Posts: 219
Joined: Sun Aug 17, 2008 5:34 am
Location: Rosario - Argentina

Post by Normando »

Centos 32bits it's ok. Are you using PAE kernel to handle 12Gb of RAM?

I am currently working with a cos server like you. Can I get root access to your server to test my zm distribution? If you want, send me a pm.
limitlessent
Posts: 46
Joined: Wed Mar 18, 2009 8:38 am

Post by limitlessent »

pm sent.
Locked