The setup
There are 7 Amcrest cameras, all the same model, feeding back 4K, 10 fps, RTSP streams to ZoneMinder. For all of them, the config is:
- Analysis FPS: 2
- Save JPEGs: Disabled
- Video Writer: Camera Passthrough
I start with Function=None on all the cameras. As I enable Modect on each camera, each one adds about 1GB of RAM and its zmc process uses 50% of a CPU.
But, when I add the 5th or 6th camera, EVERY zmc process' CPU usage jumps up to 150%. So there's this sudden jump from:
* 4 cameras x 50% of a CPU each = 2 CPUs used total
* 5 cameras x 150% of a CPU each = 7.5 CPUs used total
I also see memory spikes like this too. There's some threshold number of cameras set to Modect where the memory usage suddenly spikes from 7GB to 16GB + all my swap space. Setting "enough" cameras back to Function=None fixes it.
I don't see anything telling in the logs. I can't pin this one any specific camera. I can enable them in any order and things are fine until I get to 5 or 6 cameras.
Any idea what's going on here? Why would setting Function=Modect on a 5th or 6th camera cause all the _other_ cameras' CPU usage to triple?
I really can't use ZM under these circumstances because it just kills whatever hardware I throw at it.