Help with sizing / settings

Forum for questions and support relating to the 1.34.x releases only.
Post Reply
gruiarew
Posts: 30
Joined: Tue May 05, 2020 7:10 am

Help with sizing / settings

Post by gruiarew »

Hi,

I need some help as I need to expand my monitoring solution and based on my math I don't have enough power. Currently all is running great but I need to double the cameras and now CPU usage is 60%
CPU USAGE
CPU USAGE
CPU Zoneminder.PNG (25.27 KiB) Viewed 2419 times
I have an old Dell Optiplex 980 with an i5 3.20GHz with 12GB RAM and a DELL SSD inside it running Debian 10.5

Cameras are 4 X Hikvision DS-2CD2043G0-I doing modect on low-res and the high res is linked to low-res one. Settings attached:

Low-res
Substream
Substream
Substream.PNG (12.85 KiB) Viewed 2419 times
Main one:
Main Stream
Main Stream
Main Stream.PNG (13.81 KiB) Viewed 2419 times
What else do you recommend but not to decrease the resolution / FPS. During night when is not too much movement and I have black and white due to IR it still doesn't go below 40%. Any other settings I can tweak in Zoneminder? Zones are as small as possible, covering maximum 25% / camera view.

Thank you in advance.
User avatar
burger
Posts: 390
Joined: Mon May 11, 2020 4:32 pm

Re: Help with sizing / settings

Post by burger »

Generally when I think lower CPU, I think lower FPS / Resolution, but those aren't options here. Besides that, You can lower the pre and post image buffer. You can also adjust the zones. Use less, and make them as small as possible.

You didn't mention what your settings are in Zoneminder but it makes a difference whether you are saving JPEG or doing H264 passthrough (the latter will have the best performance). H264 encode wouldn't make sense if you already have H264 to passthrough. What are those settings?

But, in my opinion, you should just upgrade the hardware, and not worry about the settings. A dual core i5 is going to have trouble with cameras. I'd go for 8 (actual not virtual) cores, and a server CPU from 2010 or newer. Consumer CPUs just don't have the grunt required. Zoneminder is software that needs a 'real' server. This is not like running a DB or SMB file server on a server motherboard (which a lot of small businesses do) and thinking it's required, when that kind of processing can run on arm. Video analysis and processing in software eats up CPU, and you need a high performance machine.
fastest way to test streams:
ffmpeg -i rtsp://<user>:<pass>@<ipaddress>:554/path ./output.mp4 (if terminal only)
ffplay rtsp://<user>:<pass>@<ipaddress>:554/path (gui)
find paths on ispydb or in zm hcl

If you are new to security software, read:
https://wiki.zoneminder.com/Dummies_Guide
gruiarew
Posts: 30
Joined: Tue May 05, 2020 7:10 am

Re: Help with sizing / settings

Post by gruiarew »

Hi,

Thanks for the answer. I'm doing H264 pass through, as I'm getting already the stream encoded from camera. CPU is 2013. Are you sure the Xeon-like CPUs are ok for video decoding? I don't remember where I read but for this type of things is better to have some multimedia CPU extension.

Another thing, sorry I forgot to mention that, is for my home. I also need o keep an eye on the power consumption, cooling and most important, noise. What I have now is dead quiet.

On same machine I can upgrade to an i7. Would it make sense or I'm just throwing monies away?

Thanks again!
User avatar
burger
Posts: 390
Joined: Mon May 11, 2020 4:32 pm

Re: Help with sizing / settings

Post by burger »

gruiarew wrote: Fri Aug 21, 2020 5:08 pm Are you sure the Xeon-like CPUs are ok for video decoding? I don't remember where I read but for this type of things is better to have some multimedia CPU extension.
Yes, Xeon or the AMD server CPUs. You have to cite that reference. It doesn't make sense. You are saying a consumer CPU is more powerful than a server CPU. Doubtful.
gruiarew wrote: Fri Aug 21, 2020 5:08 pm for my home. I also need o keep an eye on the power consumption, cooling and most important, noise. What I have now is dead quiet.
That is a constraint I haven't had. Put the server in the basement? You can have two Zoneminder servers, with 4 cameras on each. That would allow you to have consumer hardware for each. And they would be quiet. There's no limit to how many ZM servers you can run. Run 8 RPIs if you want (actually don't do this, I'm exaggerating.)

You can try the i7, but I would use a server motherboard. I don't have enough real life experience to know if moving to a higher consumer CPU is worth it.

Think what you are trying to do: You are trying to watch 4 2K videos at once, and also do some math on 4 640x320 streams. What consumer PC will allow you to do that? Maybe a current gen gaming PC? I don't know. I think you need a server, or you need to divide up the load to multiple computers.

You could also look at quiet fans. Noctua or similar.
fastest way to test streams:
ffmpeg -i rtsp://<user>:<pass>@<ipaddress>:554/path ./output.mp4 (if terminal only)
ffplay rtsp://<user>:<pass>@<ipaddress>:554/path (gui)
find paths on ispydb or in zm hcl

If you are new to security software, read:
https://wiki.zoneminder.com/Dummies_Guide
winstontj
Posts: 28
Joined: Tue Aug 06, 2019 7:56 pm

Re: Help with sizing / settings

Post by winstontj »

You have some options. Dell and HP make tower "workstations" that are essentially server motherboards and chipsets shoved into a large desktop form-factor machine.

Regarding the noise: It's the size of the fan. The smaller the fan, the faster it needs to spin to move the same amount of air. Larger fans are quieter because it takes fewer RPMs to move the same amount of air.

In terms of power consumption: There is no free lunch. Processing power is processing power. Spending an extra $100 up front might save you $20/month in electric bills. Here are some decent flea-bay options for used quiet/tower hardware:
https://www.ebay.com/sch/i.html?_nkw=DE ... 1&_fosrp=1

I have a bunch of Dell R5500 machines as my homelab. They run Xeon Westmere 5600 series CPUs. My electric bill is only reasonable because we have solar panels on the roof. Newer CPUs would both be faster... And instead of spending $50/month for electricity, we'd probably get a check back from the power company for +$50.
gruiarew
Posts: 30
Joined: Tue May 05, 2020 7:10 am

Re: Help with sizing / settings

Post by gruiarew »

As I have no other choice for now, I have reduced the FPS to 10. I'm getting some artifacts but I can live with them. Lower than 10fps video is very ugly. It is somehow looking a bit better on CPU usage but still is not enough to double the cameras.

Does it make any sense to change the hi-res stream to record only? Will that be less stress on CPU than Nodect? Anyone has any idea on this? I plan to get an I7 in the future, that will be full tower not small form like I have now, where I can add more disks. Now I'm also limited tothe only HDD I have, a 500GB one.

Thanks a lot.
bbunge
Posts: 2934
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Help with sizing / settings

Post by bbunge »

I run a Dell i7 with 16GB ram, a 120GB SSD for the OS and database and a 1TB WD Green drive for data storage. Ubuntu 18.04 with LEMP and it rund 19 Cams just fine. Low res and frame rate as Zoneminder is not a HD movie system!
gruiarew
Posts: 30
Joined: Tue May 05, 2020 7:10 am

Re: Help with sizing / settings

Post by gruiarew »

Any input on how the cams are set? Thanks.
Post Reply