Zoneminder RAM requirements

zac_baker

Cadet
Joined
Jun 3, 2019
Messages
7
About to set up Zoneminder plugin on my Freenas, but I was wondering how much RAM would be required for smooth operation of 2-3 POE cameras (1440p). Currently, I have 16GB ECC - should this be sufficient? Thanks in advance.
 

Frank Collins

Explorer
Joined
Apr 10, 2019
Messages
53
I have 16G and it works without breaking in to a sweat. I think the CPU might be a factor too though.
 
Last edited by a moderator:

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
The question isn't really complete, but if I take it at face value (1440p = 60 fps), then you're looking at a lot more resources than if you run at a typical CCTV 5-15 fps.

RAM would not usually be an issue, a couple of GB can run several HD streams (15 fps) with no problem.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
Since FreeNAS really wants 8GB for the base system to work well, and ZoneMinder is notorious for requiring a lot of RAM, it isn't clear to me whether you might run into problems here, especially as NVR usage typically trends towards heavy pool utilization and this means stresses where ZFS uses lots of RAM to cache metaslab freespace information because there is constant demand, and then you also have large transaction groups being written, so this seems like an edgy situation with lots of RAM demand. It MIGHT be just fine, but I can easily see it being too little, which is why it'd be nice if someone with a similar setup could provide information based on experience. If the question had been "will 32GB be okay" I'd probably have said yes.
 

abishai

Cadet
Joined
Apr 12, 2020
Messages
8
This is rather simple question. I don't know how ZM installed on FreeNAS, but memory requirements depends on if you put frame buffer on tmpfs or not. If not, the memory requirements is non-existent. If yes, memory can be computed with frame size * number of frames * number of cameras.

CPU usage mostly depends on camera mode (h264 camera in passthrough mode doesn't require transcoding) and on number of motion detection zone.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
Last time I looked at ZoneMinder, which was admittedly awhile ago, it had somewhat onerous requirements for memory especially for things like motion detection, as it used shared memory for some of this functionality.
 

abishai

Cadet
Joined
Apr 12, 2020
Messages
8
Last time I looked at ZoneMinder, which was admittedly awhile ago, it had somewhat onerous requirements for memory especially for things like motion detection, as it used shared memory for some of this functionality.
It uses /dev/shm under Linux and /tmp under FreeBSD. If /tmp is not backed by tmpfs, shared buffer will be on disk.
 

Roy360

Dabbler
Joined
Nov 27, 2017
Messages
28
Min Bits of Memory = 20% overhead * (image-width*image-height*image buffer size*target color space*number of cameras)

The math breakdown for 4 cameras running at 1280x960 capture, 50 frame buffer, 24 bit color space:
1280*960 = 1,228,800 (bytes)
1,228,800 * (3 bytes for 24 bit) = 3,686,400 (bytes)
3,686,400 * 50 = 184,320,000 (bytes)
184,320,000 * 4 = 737,280,000 (bytes)
737,280,000 / 1024 = 720,000 (Kilobytes)
720,000 / 1024 = 703.125 (Megabytes)
703.125 / 1024 = 0.686 (Gigabytes)

Around 700MB of memory.

So if you have 2GB of memory, you should be all set. Right? Not, really:
  • This is just the base memory required to capture the streams. Remember ZM is always capturing streams irrespective of whether you are actually recording or not - to make sure its image ring buffer is there with pre images when an alarm kicks in.
  • You also need to account for other processes not related to ZM running in your box
  • You also need to account for other ZM processes - for example, I noticed the audit daemon takes up a good amount of memory when it runs, DB updates also take up memory
  • If you are using H264 encoding, that buffers a lot of frames in memory as well.
So a good rule of thumb is to make sure you have twice the memory as the calculation above (and if you are using the ZM server for other purposes, please factor in those memory requirements as well)

Also remember by default ZM only uses 50% of your available memory unless you change it

 
Top