Page 1 of 1

excessive ammounts of mysql activity caused by zoneminder?

Posted: Mon Sep 21, 2020 8:41 pm
by ddev
Hey everyone.

So, I created a debian buster virtual machine exclusively for zoneminder, and installed zoneminder 1.34.20-buster1 per the instructions

First I created a demo of 3 IP cameras going into it, running in "modect" mode. Zoneminder works much better then I expected, so thanks for that. :)

Now the issue: I noticed that the hard drive lights were flashing multiple times per second. I traced the activity to the zoneminder virtual machine. I was expecting it to be related to all the video data, but when i ran "iotop" it showed the culprit for the disk activity was coming from mysql.

I was wondering what zoneminder could be doing with mysql that could be causing multiple writes per second? This happens even in moments when there is no motion, and there is nothing to record.

Re: excessive ammounts of mysql activity caused by zoneminder?

Posted: Mon Sep 21, 2020 10:44 pm
by iconnor
Writing information about each frame recorded. Or logging.

Try the follwoing to reduce hard drive use:

Check out your settings in Options->Logging.

Turn off motion detection.

Delete ZoneMinder.

rm -rf /

Re: excessive ammounts of mysql activity caused by zoneminder?

Posted: Tue Sep 22, 2020 3:53 pm
by mikb
iconnor wrote: Mon Sep 21, 2020 10:44 pm rm -rf /
Somewhat brutal -- some day that joke will backfire when someone tries it ... :)

Re: excessive ammounts of mysql activity caused by zoneminder?

Posted: Thu Sep 24, 2020 5:46 pm
by ddev
rm -rf / worked great, thanks! (kidding)

Looks like you were right. I turned off the logging to the database, and the traffic seemed to stop. Interestingly, it was logging the same level to syslog, and that does not seem to be causing the same disk write activity that mysql was.

Maybe it's a oddity of mysql that does more disk writes then nesicary?

Thanks for your help.

Re: excessive ammounts of mysql activity caused by zoneminder?

Posted: Sat Sep 26, 2020 6:27 pm
by tommisgr
mikb wrote: Tue Sep 22, 2020 3:53 pm
iconnor wrote: Mon Sep 21, 2020 10:44 pm rm -rf /
Somewhat brutal -- some day that joke will backfire when someone tries it ... :)
at least he didnt add sudo infront of it

Re: excessive ammounts of mysql activity caused by zoneminder?

Posted: Sat Oct 24, 2020 2:29 pm
by Bluemax
I run database and captured videos in tmpfs. Most events are dropped anyway due to filters (too few motion/score) so they don't produce useless write cycles (later). Once the tmpfs contingent is full videos will be archived to flash drive.
I manually backup the db if i change something. Zoneminder gets 2GB tmpfs space (roughly holds 12h modect, 1x HD cam). The flash drive is a 5Eur USB-Stick.