IP Cams and stress-testing...

Add any particular hints or tricks you have found to help with your ZoneMinder experience.
Post Reply
Flash_
Posts: 441
Joined: Wed Jan 11, 2006 12:19 pm

IP Cams and stress-testing...

Post by Flash_ »

IP Cams and stress-testing...

System is running 7 Axis IP cameras. Six of these are on Modect and recording events at 640x480 greyscale @ 3-10fps.
Those same six are ALSO on Record, 320x240 greyscale @ 2fps since Modect sometimes fails to trigger reliably, and having full stream helps to narrow down the reason.
One camera is on Monitor only, no recording.
Two capture streams from each camera, and as you can see, it all works fine.

Hardware is an Athlon64 3200 running at 2ghz, 1.5Gb of RAM and a single 200g sata drive dedicated for the footage.
Debian unstable, server used for other office tasks.

Image

[quote]
top - 09:44:18 up 1 day, 23:55, 2 users, load average: 0.74, 0.73, 0.33
Tasks: 141 total, 2 running, 139 sleeping, 0 stopped, 0 zombie
Cpu(s): 34.8% us, 1.7% sy, 0.0% ni, 61.9% id, 0.3% wa, 0.0% hi, 1.3% si
Mem: 1556496k total, 1518204k used, 38292k free, 347332k buffers
Swap: 2465936k total, 0k used, 2465936k free, 417412k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
3328 www-data 15 0 115m 21m 13m S 3.3 1.4 0:10.98 zmc
3300 www-data 15 0 110m 15m 13m S 2.0 1.0 0:05.98 zma
3316 www-data 15 0 110m 15m 13m S 2.0 1.0 0:06.22 zma
3332 www-data 15 0 110m 15m 13m S 2.0 1.0 0:06.20 zma
3336 www-data 15 0 110m 15m 13m S 2.0 1.1 0:06.37 zmc
3344 www-data 15 0 110m 15m 13m S 2.0 1.0 0:06.03 zmc
3296 www-data 15 0 110m 15m 13m S 1.7 1.0 0:06.27 zmc
3304 www-data 15 0 110m 15m 13m S 1.7 1.0 0:06.01 zmc
3308 www-data 15 0 110m 15m 13m S 1.7 1.0 0:06.02 zma
3312 www-data 15 0 110m 15m 13m S 1.7 1.0 0:06.16 zmc
3320 www-data 15 0 110m 16m 13m S 1.7 1.1 0:06.29 zmc
3324 www-data 15 0 110m 15m 13m S 1.7 1.0 0:06.22 zma
3340 www-data 15 0 110m 15m 13m S 1.7 1.0 0:06.17 zma
3376 www-data 15 0 100m 5716 4824 S 1.0 0.4 0:02.93 zma
3360 www-data 15 0 100m 5712 4824 S 0.7 0.4 0:02.12 zma
3368 www-data 15 0 100m 5716 4824 S 0.7 0.4 0:02.18 zma
3372 www-data 15 0 101m 7040 4860 S 0.7 0.5 0:02.04 zmc
3384 www-data 15 0 100m 5712 4824 S 0.7 0.4 0:02.13 zma
3348 www-data 16 0 100m 6088 4860 S 0.3 0.4 0:00.66 zmc
3352 www-data 15 0 100m 5712 4824 S 0.3 0.4 0:01.12 zma
3364 www-data 15 0 100m 6024 4860 S 0.3 0.4 0:00.97 zmc
3380 www-data 15 0 100m 6044 4860 S 0.3 0.4 0:00.86 zmc
[quote]

Load spikes to 1.2 through 1.7 if modect starts recording activity.

Bandwidth - 100mbit switched lan. Throughput measured at 700-1000 KB/s, about 10% capacity.


Anyone else got some large setups, what sort of things are capable?
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

I have a 4200X2 with 16 composite cams and 7 ip cams.
All at 2 fps and all in mocord mode
All compoaites at 320x240 and all ip's at 640x480
4 x 250Gig RAID 0 for atorage Load is approx 1-3 with 2 x zm4ms running constantly with all cams viewed
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
User avatar
tech_fixer
Posts: 132
Joined: Tue Jul 29, 2003 3:07 pm

Post by tech_fixer »

Something funny about IP cameras, you can conserve CPU using JPEG mode instead of MJPEG.

I have 12 Gadspot IP cameras. These need the REGEXP parsing method to camture MJPEG streams. The CPU utilization was insane, 100% all the time. I have an Intel P4 with EMT64, 800MHz FSB and 2Gb RAM. Still, it was dead slow and there was a LOT of garbled images. So i decided to take a chance and change over to the JPEG method to see if there was any difference.

Boy, was I in for a surprise! The CPU utilization dropped down to 1-2% per monitor. Now my system only consumes around 15% CPU. I keep the cameras at 3fps, which is enough for Modect, and when an alarm is triggered they go into full throttle. Also I think it also saves bandwidth.

After thinking about it I concluded that with MJPEG, the camera sends, or pushes, a complete video stream, from which ZM chooses only a few images for capture and analysis. Keep in mind that the Gadspot cameras cannot be throttled like the Axis models. This became a real pain in the neck for me, because although I only needed 3-5fps, ZM had to receive and process the entire stream into a buffer at 10-20fps.

On the other hand, with the JPEG mode ZM only pulls the required JPEG frames from the camera, thus keeping the CPU and bandwidth utilization to a minimum. It also results in less garbled images and excellent motion detection.

Now I can add another 12 cameras... :wink:

Hope this helps someone.

Regards,
Jose.
Post Reply