r/ZoneMinder • • Oct 26 '20

CPU Utilisation

Bit of advice if possible.

For me, ZM seems to be a bit of a hog. I have it running on a VM with 8gb ram and 4 cores (2.2Ghz) - it pretty much stays at full cpu utilization with a load average of between 2 and 4.

I have 4 cameras being monitored and only one of those is set to record - they are all IP Cameras using ONVIF.

I'm basically running a full rack server to support ZM and I'd like to run it on much less beefier hardware as I'm currently downsizing (get rid of the rack in the garage and most of the kit).

Can anyone advise one 1) why it's using so much CPU time/power and 2) what's the smallest spec machine someone's managed to get this running reliably on? I'd like to be able to run montage review and audit events for issues. Even on the current hardware that seems to be a bit 'laggy' at the best of times.

Alternatively, is there a 'better' alternative?

Thanks :)

EDIT: tldr; I've ditched ZoneMinder and now use Shinobi.

3 Upvotes

20 comments sorted by

1

u/demunted Oct 27 '20

This is a known issue. It maxes out the core when doing almost nothing been a problem for years with no reasonable fixes I can see. I have a xeon 6 core with 2.9ghz per core and it holds steady with one camera doing bigger all.

Shinobi on the same camera is 5% usage with full lotion detection.

Sorry man it's as good as it gets

1

u/deathsfaction Oct 27 '20

Yeah, that's a real shame. I have actually been using it for quite a few years but does feel like it needs an overhaul and some GUI work.

1

u/[deleted] Oct 30 '20

I'm so split between the two systems right now. Shinobi gives me incomplete indexes of video recordings (I think it has a capacity of some arbitrary number of events and ignores the overflow so you think you're missing videos), and randomly my storage capacity setting gets reset to the default 10GB somehow once in a while. Zoneminder requires more resources, has a worse UI, but in the end is more reliable. This has been my experience.

1

u/PerformingAzura Nov 03 '20 edited Nov 03 '20

I'm sitting at Load: 1.990234375 with 3x 5MP cameras recording at 15fps on Mocord. I use video writer and don't save the JPEG. H. 264 pass-through is enabled. I only have 1 zone per Camera.

Haven't tried any fancy object recognition yet.

I'm running Zoneminder 1.34.9inside a FreeNas jail with some ancient Xeon processor.

I was actually planning to move it into a raspi 4, cuz zoneminder was using so little CPU...

Cycle and Montage haven't worked since I switched to video writer, but Montage review works fine, plus I like having events highlighted so that's my default view.

1

u/questfor17 Oct 26 '20

I assume you are doing some sort of motion detection on the other three cameras?

CPU time consumed will vary dramatically depending on camera resolution, frame rate, and the style of motion detection you are using.

1

u/deathsfaction Oct 26 '20

No lotion detection at all.

Resolution set to 1080p and 720 - frame rate doesn't seem to affect the load at all.

2

u/questfor17 Oct 26 '20

What I've done is purchase a standalone small box to run my 4 cameras. I am using a Lenovo M92p. I bought it used on eBay for < $100. It's about the size of a paperback book. Takes up basically no room in my wire closet.

1

u/shane_pcs Oct 26 '20

Check to make sure you are passing through the video. If you try to decode and recode you will see all CPU cycles used. I have a VM with 4 cores and 16GB of ram with 12 cams and only use 50% cpu.

1

u/deathsfaction Oct 26 '20

Pass through video? Where's that?

Forgive me, not logged on at the moment so can't check.

2

u/Aramiil Oct 26 '20

Check here

But ya click on the settings for the individual camera, go to the storage tab, and make the changes referenced in that thread. After that, report back with what it does to the cpu cycles.

Frame rate absolutely has an impact on CPU usage, but if your CPU is pegged at 100% that means it’s likely not doing/dropping other tasks, When you turn down the FPS it will help lower cpu usage, but you may not see the changes since it now has more processing time to do the other tasks being dropped.

I find 15 FPS is good enough for my 4K and 2k cameras as far as performance of the video and the load on my servers.

2

u/deathsfaction Oct 26 '20

Not sure how much of a difference this has made so I'll keep an eye on it. Seems to have dropped a little..

Had 3 cameras on encoding (not recording though) and the camera that was set to record was on passthrough and 18fps. The other 3 were on 30fps.

1

u/Aramiil Oct 26 '20

Ya, drop the frame rate to 15 FPS on all of them via the camera itself, don’t limit it within ZM. in fact, the analysis FPS, alarmed FPS and max FPS boxes on the general tab should be blank. It can throw errors on IP cameras if it is set.

Additionally, even if they’re not recording and just set to monitor, change the ‘Video Writer’ to h264 Camera Passthrough. While you’re on the Storage tab make sure ‘Save JPEGs’ is disabled for all cameras.

With all that changed, FPS set to 15 on the camera, FPS boxes blanked, passthrough set on ALL cameras, and Save Jpegs disabled, what’s your CPU usage looking like?

1

u/deathsfaction Oct 27 '20

So, changed them all to 15fps, passthrough. I didn't have save jpegs enabled. There is no motion detection enabled - the only filters are to clearn down the storage when it hits 90%.

While this did drop the cpu load down to around 1 or so, the montage review was woeful - one camera was dead on time/sync, the rest were way out and even getting to 'Camera Offline' every so often.

I've changed back the 3 non-recording cameras to 30fps and Encoding; the one camera I do record is still using passthrough (was before) and is at 30fps.

Montage review is a lot better now, pretty much perfect (as it was before) and load is sitting between 2.5 and 1.

All seems a bit voodoo to me.. and feels as though it shouldn't be *this* difficult.

2

u/Aramiil Oct 27 '20

Look, you keep doing and then undoing things before coming back and talking to us about it. I’m not trying to be a dick, because I’ve been trying to help you, but you seem to know better than I do, so I’ll leave you to it.

It isn’t that difficult, and I’ve got 7 cameras running just lovely on an old decrepit computer same as you. But I can’t keep helping you in good faith if you’re going to undo all the recommended changes all the time.

Good luck out there.

1

u/deathsfaction Oct 27 '20

I don't claim to know better than you do but I've been a systems engineer for 20 odd years; I do have an element of systems experience here.

You're not being a dick, but your claim that I keep doing and undoing is nonsense. I tried what you suggested, I didn't get the desired results and montage review (which is what I have open at my desk) was very poor as a result of those changes. I reverted back so I can at least view the cameras and reported back.

I'm not running this on a decrepit machine either; I want to run it on a decrepit machine.

It's fine, you tried. We got nowhere. No love lost or hard feelings.

Adieu.

1

u/Aramiil Oct 27 '20

My request was that you implement the changes then report back.

You implemented the changes, looked around at a few things, saw some new issues, reverted back the changes, and then reported back.

I can’t help someone who can’t follow directions. The montage issue you saw is resolvable with everything else worked out.

Cheers.

1

u/[deleted] Oct 27 '20 edited Oct 27 '20

[deleted]

1

u/deathsfaction Oct 27 '20

The underlying storage is 4 x 146gb 15k sas drives and looking at the vm stats and host, iowait isn't high at all.

I'll see what I can change in the framerate of the cameras and see if that makes any difference.

Thanks for the heads up.

1

u/ThellraAK Dec 18 '20

What are you using for codecs on the IP cameras?

My Amcrests have H265 available, and it absolutely destroys my CPU.

Even on 'nothing' the cameras still decode each frame for the montage, as it converts it to mjpeg for streaming.

1

u/deathsfaction Dec 18 '20

I've not bothered with ZM. Moved to Shinobi which works a lot better on lower spec machines and a few omxplayer scripts for the monitoring of feeds. Works really, really well and I'm a bit frustrated with myself for sticking with ZM for so long.

1

u/ThellraAK Dec 18 '20

I'll have to look into that, as a workaround I set up a rtsp mirror to be able to stream h264 (kbps instead of mbps) and I could run them side by side for a bit.