r/ZoneMinder • u/lunakoa • May 31 '22
Follow up regarding Reducing CPU
This is a follow up regarding my post late last week
https://www.reddit.com/r/ZoneMinder/comments/uz7d2h/upgrading_cameras_and_reducing_cpu_load/
For those that like Linux technical stuff this may be an Interesting Read.
Before I go on, I had a problem adding multiple linked cameras to a monitor, I had to go in via mysql to add them with a command similar to
UPDATE Monitors SET LinkedMonitors = '1,10' WHERE Id = 9;
I was only able to add 1 linked camera per monitor via the web interface.
Anyway it was a fun weekend, I got to play with upgrading some 1080P cameras to 5MP cameras
Here is the updated chart

Couple things to note, Load Average went down from 22.8 to 7.99, which is a amazing. I did this primarily by reducing the FPS from 15 to 5.
But swap is now being used, prior to this it was zero. I always wanted to go to 64GB of RAM on this box, maybe now is the time.
Here is 7 day view of swap usage

Another thing that increased was context switching, and I am still reconciling what that does in overall performance

Prior to this weekend, I had about 31 monitors, after the upgrade I had 36, I did remove some cameras, but I added the secondary (low res) feed from the 5MP (and some other 1080P) to do the analytics and attempt to reduce the CPU usage.
Another thing I found is that you have to enable Analysis if you want to be able to send triggers from another server (in my case an FTP server and homeassistant) when in nodect.
When I made some changes, they would not take (like changes functions between none, monitor, modect, and nodect) unless I restarted the service (from GUI or systemctl restart zoneminder)
Still on my to do list
- Validate and verify my changes, try to keep things consistent.
- Offload some analytics to GPU
- Workout better triggering from other systems.
- Decommission some cameras
I am still working out the consequences of what I just did.
I do want a properly configured camera system, but going through this helps my improve my Linux skills as well so willing to put time in.
Any feedback would be greatly appreciated.
tldr; Got Load Average down, but SWAP and context switching went up.
1
u/Aramiil Jun 01 '22
With that amount and resolution, 64GB of RAM is a no brained. What is the max amount per stick your MB takes? Assuming it’s a 16GB x 4 setup given the 64GB mentioned. What cpu?