CPU/Processor selection and Camera scaling Guide (draft)

Post here to ask any questions about hardware suitability, configuration in ZoneMinder, or experiences. If you just want to know if something works with ZoneMinder or not, please check the Hardware Compatibility sections in the forum, and the Wiki first. Also search this topic as well.
Post Reply
drose25
Posts: 19
Joined: Fri Jan 20, 2012 2:00 am

CPU/Processor selection and Camera scaling Guide (draft)

Post by drose25 »

So, I have read every thread in the forum that discusses CPU or processor recommendations and the number/type of cameras that specific configurations may support, and I've read through pretty much everything on the Wiki, and it seems that CPU selection for any particular ZoneMinder installation is much more an art than a science. :D Given the immense number of options I've learned about during this process for customizing and tweaking ZoneMinder to particular hardware builds, and the sometimes very substantial performance enhancements they bring, I can see why people on the forums are very hesitant to respond to general questions about CPU sizing, especially since most posters have yet to learn about half of the possible variables that need to be considered to answer the question effectively.

Below is a summation of the "hard" information I have gleaned from my searches. I am compiling it here in hopes of helping others with similar questions, and with the hope that some of the gurus that visit here might be able to answer some of the questions raised by the information, as enumerated further down. If you can provide any information about your specific ZoneMinder setup that might help further refine this post, please do so. Be as specific as possible with respect to things like image resolution, framerate, custom optimizations, etc. so we can try to compare as many apples to apples as possible. Right now this list mainly compares just fruit to fruit...

Methodology: I'm attempting to quantify the approximate number of bogomips required per camera, as this seems the simplest way of relating camera load to processor specs. At this point, the information I have collected is fairly general. Hopefully with more information from other posters, we can narrow this down by camera type (analog/IP), resolution, framerates, etc. I'll summarize specific posts or Wiki entries, and my presumptions based on them, first before compiling a simple chart for quick reference.

At the very low-end of things, the Wiki states that an "ancient Pentium II PC" should be able to track one camera per device at 25fps. Multiple cameras on the same device (capture card, presumably) take a substantial FPS hit, but the Wiki seems to suggest that single cameras on multiple devices would not suffer the same performance hit. It's a little unclear, so to be safe, I'm going to presume that an "ancient Pentium II" can safely handle one analog camera. Specs were not mentioned, so I'm going to presume a black and white image with a 320x240 resolution. A bit of Googling reveals that the most powerful Pentium II (450mhz) was capable of ~ 900 bogomips.

In the middle of the scale, one poster questioned whether an Atom D510 dual-core processor would be sufficient to handle 2 IP cameras with color images at 640x480, 30fps, for motion detect and record. A responder did a bit of investigation and reported that the processor performed about 3325 bogomips per core, and noted that a dual-core version of that processor should be sufficient.

At the upper end of the scale, one poster reported successfully running 33 IP cameras on a single HP ML115 server, consisting of 2gb RAM and an AMD quad-core processor capable of ~ 18,000 bogomips. Of these 33 cameras, 20 were set to record only and, of these, 10 were greyscale and 10 were color, all at 640x480 and 1.25fps. The remaining 13 cameras did single-zone motion detection, with "best, most sensitive" settings, and all were color, 640x480, and 3fps. The OP reported the 20 record-only cameras resulted in system loads between .1 to .2 before the motion-detect cameras were added, and afterwards the system load went up as high as .21. Looking at the graphs he kindly posted I'm not sure the latter .21 load number is entirely accurate, but I'm not great at reading these kind of things so you may want to investigate yourself if interested.

Code: Select all

No. of Cams/type            No. of Bogomips
1 analog/BW/320/25fps              900
2 IP/color/640/30fps               6650
33 IP/mixed/640/~2fps              18,000
From this information, all we can really say is that a single analog camera (BW/320/25fps) requires no more than 900 bogomips, while a single IP camera (color/640/30fps) requires no more than 3325 bogomips. So a color IP camera at twice the resolution of an analog camera may require no more than roughly 3x the number of bogomips at roughly the same framerate.

These figures do not take into consideration other hardware factors like RAM or system optimization, as noted above, because most posters did not provide this information. Also not considered is whether ZoneMinder imposes any minimum bogomip overhead that would make the addition of more cameras less expensive in bogomip terms than the initial camera.

Using this information: My initial thought was "Great! Just multiply the number of cameras by the bogomips required for that camera type and you'll know what processor to start looking at." I soon realized this might work great in the world of single-core processors, but most servers recently utilized multiple cores or threads and I question whether simple multiplication will accurately determine bogomip requirements for these processors because I am unsure how effectively the system can split the load between cores or threads. Here's an example:

Assume 4 cameras that require 1000 bogomips each, for a total of 4000 bogomips. A single-core processor capable of 4000 bogomips would presumably be sufficient. So would a quad-core processor that provided 1000 bogomips per core, as each camera thread could be offloaded to a single core or thread. But what about a tri-core processor capable of 4000 bogomips? You have 3 cores at 1333 bogomips per core... You could run 3 of the cameras without difficulty, as each could run on a core with more than ample processing power. But what happens to the fourth camera's thread? To my limited knowledge, modern OSs cannot split a single thread among multiple cores (or we wouldn't need multi-threaded apps in the first place, and AMD's Bulldozer line wouldn't be such a benchmark disaster). So this means one core winds up with two threads, each starved for about 350 bogomips. 2 cameras would operate in real-time without trouble, but 2 cameras would start to generate a backlog. Whether this would become significant or not depends a lot on how the OS rotates the load between cores, which is something entirely out of my realm of technical knowledge. Hopefully another poster can enlighten us on how this might work. For the moment, however, it would appear you need to consider the number of cores/threads and the number of cameras, in addition to the system's overall bogomip capability.

Obviously this is all very simplistic and generalized information at this point. I hope other posters can help us narrow things down substantially so some useful guidance can be provided to new ZoneMinders trying to determine their hardware requirements. As those of you new to ZoneMinder can see from this post alone, things like framerate and resolution can make a huge difference in the processing power required per camera. If you need to ask for advice in the forums, try to specify as much of that information as possible so other posters can realistically answer your question. I'd suggest reading up on framerates first--my initial assumption was something around 30fps would be ideal. Big mistake. These aren't movies, just security footage, as many other posters have pointed out. Often 5fps or less is more than ample.

I hope this helps, and I hope other posters add their own experiences so this list can grow and become more precise. I will try to edit this post as necessary to keep it updated as well.
Boozin
Posts: 1
Joined: Fri Mar 02, 2012 12:53 am

Re: CPU/Processor selection and Camera scaling Guide (draft)

Post by Boozin »

Just got started using ZM myself, have it setup with 2x IP cameras running 640x480, running BW primarily (they do rarely switch to "day" color mode). This is handled by an old athlon CPU; the /proc/cpuinfo

processor : 0
vendor_id : AuthenticAMD
cpu family : 6
model : 6
model name : AMD Athlon(tm)
stepping : 2
cpu MHz : 1049.910
cache size : 256 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 1
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 mtrr pge mca cmov pat pse36 mmx fxsr sse syscall mp mmxext 3dnowext 3dnow up
bogomips : 2099.82
clflush size : 32
cache_alignment : 32
address sizes : 34 bits physical, 32 bits virtual
power management: ts

This setup is able to just barely run each camera at 5fps, so 10fps total at 640x480 B&W. I tried pushing it a bit more, and the load goes well over 1 and it gets flaky. With both cams set up in Modect set up over the whole frame,

load average: 0.95, 0.92, 0.97

Loading up the web console pushes that a bit high!

load average: 1.17, 1.00, 0.98

Luckily there does not seem to be any ill effects from playing back footage or viewing the sources in montage mode for short periods of time. A note on software, this is ubuntu running a stripped down xwindows (that I don't use). Per the docs it may be possible to get a more optimized binary, but this is using things as "out of the box" as possible with 1.24.4.

With that being said I am looking at building a new server that can handle the IP cams as well as a traditional 4 feed analog PCI card. Currently I am looking at the new AMD "Llano" chipsets that have gfx and cpu on the same dies for a decent price. My only reservation is if they would have enough guts to do what I want it to do.
mastertheknife
Posts: 678
Joined: Wed Dec 16, 2009 4:32 pm
Location: Israel

Re: CPU/Processor selection and Camera scaling Guide (draft)

Post by mastertheknife »

Take a look at my patch for ZM:
http://www.zoneminder.com/forums/viewto ... =9&t=17652

mastertheknife
Kfir Itzhak.
drose25
Posts: 19
Joined: Fri Jan 20, 2012 2:00 am

Re: CPU/Processor selection and Camera scaling Guide (draft)

Post by drose25 »

Well, I finally got most of my setup up and running and I was rather surprised with the results. I was expecting more load on the CPUs than I have encountered so far.

Hardware:
1 Rackable 2U half-depth chassis with 2x Intel Xeon L5420 (2.50GHz) quad-core processors (~5,000 bogomips each)
16GB ram
1 Hitachi SATA drive (5940 rpm)
1 Bluecherry PV-981A-8A 8-port card (4x BT878 PCI-E card)

Software:
Ubuntu 11.10 Desktop, 64-bit
ZoneMinder 1.25.0 (following this install guide http://www.zoneminder.com/wiki/index.ph ... rom_source) (no optimizations yet)
NX Server for remote desktop access

Settings:
640x480, color (B&W at night), motion detect on "best, medium sensitivity", 10FPS normal, 15FPS on alarm

Currently running four wired cameras with loads around .15, rarely up to .20. Will be added 3 more wired cameras and one IP camera here soon and I'll update the results.
Post Reply