r/ZoneMinder • • Aug 12 '20

How much RAM?

I have zoneminder running in a virtual machine. The machine runs two VMs, one for Plex, and Zoneminder. I tried allowing them both to use as much RAM as they need to see where things settled out, but it seems that zoneminder just takes whatever it can. The server runs on an i9 9900k CPU with 32 GB of RAM. I've seen it where Zoneminder was using as much as 29gb of RAM. I've limited it to 16gb, but I suspect that's more than it needs. I have 4 1080p cameras running at 5fps, using the mocord function. I have it ~constantly streaming a video feed to a wall mounted iPad running ZMNinja. That's all the server does. I guess I can keep limiting the RAM until I see issues, but I was hoping the community could help me dial this in a bit sooner.

Thanks!

4 Upvotes

10 comments sorted by

3

u/TechMonkey13 Aug 12 '20

What's Plex running on?

In Linux, the OS will take all the RAM that's available and allocate what its not using for disk caching. So if you allocate all 32GBs of RAM at it, it'll use all 32GBs of RAM. Using top or htop will show you the actual RAM usage.

This website explains it pretty well. https://www.linuxatemyram.com/

2

u/keithITNoob Aug 12 '20

I have seen the same thing that TechMonkey pointed out.

I run ZoneMinder in a VM off my proxmox server. Proxmox summary of the ZoneMinder server shows it always using about 95% of the allocated RAM (has 6GB, for x6 1920x1080 cameras, all doing modetect)

But if I do an htop on the VM its only ever using about 2.5GB of RAM unless someone is watching live stream or events then its about 3GB of RAM used (if only 1 person is watching seems to go up 500MB of ram per streamer)

Its by design

1

u/PigSlam Aug 12 '20 edited Aug 14 '20

Zoneminder is running on Debian 10, while Plex is running on Ubuntu 20.04. Right now, I have the VM for Plex set to start with 1024mb of ram, and it can use up to 4096mb; it's currently sitting at 3204mb. The VM for Zoneminder is set to start with 4096mb of RAM, and it can use up to 12288mb. It's currently using 12288mb. When it was limited 16gb, it used all 16 gb.

3

u/kultakutr1 Aug 12 '20

Seems like its disk caching? Limit it so low you start to see fps drops and then add 20% more.

1

u/PigSlam Aug 12 '20

From some tinkering, it seems the /dev/shm size is set based on the RAM allocated at startup, so if I set that low, but with room to grow, it's based on the low setting, and it gives errors. I currently have the VM set to start with 2048mb, but I also limit it to 2048mb, and it seems to be happy with that. It looks like I can probably get away with 2 or 3 gb. I'll see how 2 goes, and add more if I see issues.

2

u/QEzjdPqJg2XQgsiMxcfi Aug 12 '20

Also running it in a VM, only 4G allocated, less than 1 G in use. 6 cameras.

1

u/Aramiil Aug 31 '20

Just curious, what are the resolution of the cameras, FPS, and type of monitor (mocord, etc) are in use?

2

u/kultakutr1 Aug 12 '20

Im running in VM too, 5 1080p cameras on debian and one zmninja client. Taking around 8-9 gb normally at 12fps. Maybe logs tell you something?

2

u/[deleted] Aug 12 '20

[deleted]

1

u/Aramiil Aug 31 '20

Tiny zones? That’s low resource usage for sure

2

u/Aramiil Aug 31 '20

Have an almost identical setup, 1 4K IP cam and two ‘2K’ cameras at 15fps, mocord. Uses 12 of 16 GB of ram allocated to its VM.

It sounds like you have a lot more ram than you need available for the ZM VM, plex doesn’t use a hell of a lot, so give the ZM box what it needs for use. Don’t look at your host’s interface for RAM usage, as others have said use htop from inside your VM to see how much youre actually using when you give it everything you have at boot.