Hi,
I'm currently running ZoneMinder 1.29.0 to continuously record streams from 4 networked cameras at ~30 fps (704x480 resolution). The embedded machine running ZoneMinder is a bit under-powered (single core Intel Atom at 2 GHz) and really seems to struggle with this task. Load average is around 4.53 and my main concern is dropped frames.
I would like to optimize my ZoneMinder configuration for continuous record (no motion detection or image analysis). I have already unchecked the RUN_AUDIT option as it can cause data loss issues for my application, but am using the default ZoneMinder settings for almost everything else. I have noticed that the 'zma' processes are consuming a lot of CPU resources; are these processes necessary if no image analysis is being done? I am using the 'Record' function on each stream, is there another option I need to set to prevent ZoneMinder from attempting image analysis?
Another issue I have is that my mysql database gets corrupted about once a week and needs to be restored from a backup I created just after installing ZoneMinder. I believe this is caused by the huge number of entries written to the database for the continuously recorded frames. My image data is being archived to an external drive and I don't have much use for the events database other than to confirm recording occurred at any given time. I have thought about periodically running a filter to delete all events from the database as a workaround, but there must be some better way to handle this. Would it help to increase the BULK_FRAME_INTERVAL option? It is currently set to the default value: 100.
Thanks for the help!
Optimizing for Continuous Record
Re: Optimizing for Continuous Record
Linux distro and version? MySQL version?
Re: Optimizing for Continuous Record
Sorry, Ubuntu 14.04.4 Server (32-bit). MySQL 5.5.49.
Re: Optimizing for Continuous Record
First lower the frame rate at the cameras. 5 fps should be good for what you are doing and should lower the processor load.
With a 32 bit system you may bump against the 4 GIG memory limit. If you do not have 4 GIG RAM you should! Also set the swappiness value so your system will use most of the RAM before swap disc kicks in:
------------------------------------------
To check the swappiness value
cat /proc/sys/vm/swappiness
To change the swappiness value A temporary change (lost on reboot) with a swappiness value of 10 can be made with
sudo sysctl vm.swappiness=10
To make a change permanent, edit the configuration file with your favorite editor:
sudo nano /etc/sysctl.conf
Search for vm.swappiness and change its value as desired. If vm.swappiness does not exist, add it to the end of the file like so:
vm.swappiness=10
Save the file and reboot.
-------------------------------------
Check MySQL and make sure you are using innodb_file_per_table
Install mysqltuner and see what it recommends especially innodb_buffer_pool_size With low RAM you could bump up against memory limits...
Zoneminder
Check Paths and move PATH_MAP, PATH_SOCKS and PATH_SWAP to tmpfs (think it is /run/shm for 14.04). Tmpfs (RAM) will be faster for you than writing to the hard drive.
There are likely other things you could do, 64 BIT machine for one. Good luck!
BB
With a 32 bit system you may bump against the 4 GIG memory limit. If you do not have 4 GIG RAM you should! Also set the swappiness value so your system will use most of the RAM before swap disc kicks in:
------------------------------------------
To check the swappiness value
cat /proc/sys/vm/swappiness
To change the swappiness value A temporary change (lost on reboot) with a swappiness value of 10 can be made with
sudo sysctl vm.swappiness=10
To make a change permanent, edit the configuration file with your favorite editor:
sudo nano /etc/sysctl.conf
Search for vm.swappiness and change its value as desired. If vm.swappiness does not exist, add it to the end of the file like so:
vm.swappiness=10
Save the file and reboot.
-------------------------------------
Check MySQL and make sure you are using innodb_file_per_table
Install mysqltuner and see what it recommends especially innodb_buffer_pool_size With low RAM you could bump up against memory limits...
Zoneminder
Check Paths and move PATH_MAP, PATH_SOCKS and PATH_SWAP to tmpfs (think it is /run/shm for 14.04). Tmpfs (RAM) will be faster for you than writing to the hard drive.
There are likely other things you could do, 64 BIT machine for one. Good luck!
BB
Re: Optimizing for Continuous Record
We are monitoring birds as they fly over at night using thermal cameras, so 30 fps is necessary.
I am already using innodb_file_per_table, but I will install mysqltuner to check recommended values as well as experiment with swappiness. Thanks for the advice.
Should the zma process be running or just zmc?
I am already using innodb_file_per_table, but I will install mysqltuner to check recommended values as well as experiment with swappiness. Thanks for the advice.
Should the zma process be running or just zmc?