Page 1 of 1

Finally my zm is working for me!

Posted: Mon Jul 04, 2016 2:05 pm
by jbg70
Hi, hope to share what I got during some googling about my zoneminder installation.
If something will be dangerous please let me know.

My story:
I am using zoneminder since many years, but I used it always with slow cpus and had just with one or two cameras.
Recently I got a Xeon 1246v3 and wanted to use as surveillance system. I wanted to use 4-5 cameras at 1280x720 at 25fps in mocord.
Once configured, I discovered that when an alarm occurred, most of 25 FPS were lost, and recording fps went down up to 2-3fps.
CPU load was max to 23% for each zm process, so not CPU issue.
I looked at I/O "side". I had [jbd2..] process most of the time at 99% when an alarm went up. I have a not so bad 1TB WD10EARS with ext4 fs.
Also the [jbd2..] process went up with mysql queries, so I moved my attention at mysql.
Googling a little bit, i found some parameters to put into mysql config file (my.cnf):

Code: Select all

innodb_read_io_threads=4
innodb_write_io_threads=8
innodb_buffer_pool_size=20G
innodb_buffer_pool_load_at_startup=ON
innodb_log_file_size = 32M
innodb_log_files_in_group=2
innodb_file_per_table=1
innodb_log_buffer_size=8M
innodb_flush_method=O_DIRECT
innodb_flush_log_at_trx_commit=0
skip-innodb_doublewrite
Sorry but I know the meaning just for some of them.

Once set them into my my.cnf file, I restated mysql, and [jbd2..] process went really down and I do not loose any recorded frame even when more than an alarm occur. At this moment I am running in mocord 3 ipcam at 1280x720@25fps and 1 at 1280x960@20fps without any issue.

System load is 1% if no alarm, it goes max at 1.5 with 2 alarms (it is a quad core cpu with a virtual core each real core).

Hope this can be helpful for someone.

Re: Finally my zm is working for me!

Posted: Wed Jul 06, 2016 9:29 pm
by bbunge
What Linux distro are you using?

Depending upon the version of MySQL, adding innodb_file_per_table will not help unless you recreated or converted the zm database.

I recommend you run mysqltuner from time to time as some MySQL paramaters, like innodb_buffer_pool_size, will need to be adjusted as the number of recorded events grows.

bb