Guide: Performance tuning for very low CPU usage

Add any particular hints or tricks you have found to help with your ZoneMinder experience.
Post Reply
mrkrille122
Posts: 1
Joined: Sat Oct 08, 2022 6:57 am

Guide: Performance tuning for very low CPU usage

Post by mrkrille122 »

Hello Everybody

In these times, with the soaring electricity prices, it has become more and more important to save where you are able to.
Therefore i wanted to make this post, to share my experiences with tuning ZoneMinder to run with an extremely low CPU usage

Currently i run 2x Interlogix TVD-1104 cameras at 1080p on zm in lxc container (proxmox). This runs on a i7-4790 but limited to two cores.
CPU usage of the zm container over 24h averages 2%

To set this up correctly, you will need cameras with dual stream capability (main/sub)
add both streams to zoneminder.
set the sub stream to a low resolution and framerate, from the camera (i run at 352x288 with 1 fps and Iframe-interval = 3)
substream Function has to be modect. (i call the substream the camera name and add _sub to the end)

set the main stream to your desired resolution, from the camera (i run 1920x1080 with 20 fps and Iframe-interval = 10)
main stream function has to be nodect and remember to add the substream as the Linked Monitor.

For all monitors make sure to set video writer to camera passthrough.
For the main streams set "Save JPEGs = Disabled" and under Function disable Analysis and Decoding.

That should be it. remember, that you will not be able to watch your main stream live from the zoneminder web gui.
This is because there is no "limit decoding unless required" function, like there is in blueiris. I would love for a function like this to be implemented one day, as it would ease the idle cpu load for a lot of users.

Now, zoneminder will only spend CPU, analysing motion at low resolution and 1 fps, and then just write the main stream (and sub) directly to disk on motion capture. You will of course be able to view your events in full resolution.

I hope someone found this helpful.
Post Reply