excessive ammounts of mysql activity caused by zoneminder?

Forum for questions and support relating to the 1.34.x releases only.
Post Reply
ddev
Posts: 4
Joined: Mon Sep 21, 2020 8:20 pm

excessive ammounts of mysql activity caused by zoneminder?

Post 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.
User avatar
iconnor
Posts: 2882
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: excessive ammounts of mysql activity caused by zoneminder?

Post 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 /
mikb
Posts: 586
Joined: Mon Mar 25, 2013 12:34 pm

Re: excessive ammounts of mysql activity caused by zoneminder?

Post 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 ... :)
ddev
Posts: 4
Joined: Mon Sep 21, 2020 8:20 pm

Re: excessive ammounts of mysql activity caused by zoneminder?

Post 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.
tommisgr
Posts: 23
Joined: Mon Aug 31, 2020 6:28 pm

Re: excessive ammounts of mysql activity caused by zoneminder?

Post 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
User avatar
Bluemax
Posts: 121
Joined: Wed Jun 12, 2019 5:15 pm

Re: excessive ammounts of mysql activity caused by zoneminder?

Post 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.
Post Reply