Database growing fast

Forum for questions and support relating to the 1.31.x releases only.
Locked
juanmoura
Posts: 91
Joined: Fri Nov 24, 2017 11:46 am

Database growing fast

Post by juanmoura »

Friends, I've come across this situation at the same time. I believe ZoneMinder is storing frames of events inside the MySql database. My suspicions came from the fact that I use the system with a separate database, in this way I got more performance for the image server and started to create metrics of the VM that is the bank.
I use in both cases Ubuntu Server 16.04 LTS. Use as database MariaDB. My system runs perfectly and smoothly in version 1.31.42 StorageAreas.

My database grew from 1.38GB to 20.44GB in 20 days.
A system with 32 cameras.

Any idea how to reduce it?
The growth is absurdly large and fast.


Image
bbunge
Posts: 2956
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Database growing fast

Post by bbunge »

How many events?
My production database is 775 Meg with 61K events. Most of the 17 cameras are recording at 5 FPS with four on Mocord from 0700 - 1700 M-F.

Make sure you gave Mariadb all permissions for ZM
mysql -uroot -p -e "grant all on zm.* to 'zmuser'@localhost identified by 'zmpass';"
juanmoura
Posts: 91
Joined: Fri Nov 24, 2017 11:46 am

Re: Database growing fast

Post by juanmoura »

bbunge wrote: Mon Apr 30, 2018 12:57 am How many events?
My production database is 775 Meg with 61K events. Most of the 17 cameras are recording at 5 FPS with four on Mocord from 0700 - 1700 M-F.

Make sure you gave Mariadb all permissions for ZM
mysql -uroot -p -e "grant all on zm.* to 'zmuser'@localhost identified by 'zmpass';"
My system have 2451234 events with 1TB just recorded. 32 cameras with 6 FPS.

My permissions are mysql -uroot -p -e "grant all on zm.* to 'zmuser'@10.10.70.200 identified by 'zmpass';"
The ip is my server. I use Multiserver.
User avatar
iconnor
Posts: 3269
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Database growing fast

Post by iconnor »

The three big tables are Events, Frames, Stats and Logs. You might try deleting the logs more frequently. You can also turn off Stats recording.
Locked