Buffer Overruns only when purging events

Forum for questions and support relating to the 1.29.x releases only.
Locked
Steveearle86
Posts: 16
Joined: Wed Oct 28, 2015 1:19 pm

Buffer Overruns only when purging events

Post by Steveearle86 »

Hi all,
I have been using Zoneminder for a few months now and am very happy with it, although I experiencing an annoying issue:

I am running 1.29 on Ubuntu 15.10 on the following PC:

Code: Select all

cpu:
                       Intel(R) Core(TM)2 Quad CPU    Q6600  @ 2.40GHz, 1600 MHz
                       Intel(R) Core(TM)2 Quad CPU    Q6600  @ 2.40GHz, 1600 MHz
                       Intel(R) Core(TM)2 Quad CPU    Q6600  @ 2.40GHz, 1600 MHz
                       Intel(R) Core(TM)2 Quad CPU    Q6600  @ 2.40GHz, 2400 MHz
graphics card:
                       Intel 82G33/G31 Express Integrated Graphics Controller
OS HDD is a Corsair SSD and the Zoneminder HDD is Seagate Barracuda 3.5 inch 2TB 7200 RPM. The PC has 4GB RAM

I have two cameras which are recording @ 720p and 5fps on Mocord.

The load reading at the top of the index page is generally between 0.2 and 0.8 and is very stable.

I am using the PurgeWhenFullFilter which runs when the disk gets to 95% full and deletes the oldest 30 events. When the deletion is happening, the load goes to about 2.2 and causes bufer overruns, causing the events to stop and a new event to be created. This is the error I get:

Code: Select all

2016-05-16 19:26:04.508192	zmc_m8		15704	WAR	Buffer overrun at index 20, image 1662520, slow down capture, speed up analysis or increase ring buffer size	zm_monitor.cpp	3100
This causes about 10 extra events per day on each camera and causes a break in recording

I currently have OPT_FAST_DELETE set to off, however, when I had it switched on, the behaviour above would happen when zmaudit was doing it's clean up.

One camera has a zone which is the whole view and the other camera has a small zone.

I am wondering what I can do to prevent this from happening?

Can anyone help?
bbunge
Posts: 2956
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Buffer Overruns only when purging events

Post by bbunge »

Check MySQL settings by installing and running mysqltuner. Without more info it appears you may be running out of memory possibly for MySQL. By default, Ubuntu uses half of your RAM for tmpfs. It is possible that MySQL needs more memory (buffer_pool_size) allocated. A df will show you if you have used up space in /dev/shm or other areas of tmpfs.

bb
Steveearle86
Posts: 16
Joined: Wed Oct 28, 2015 1:19 pm

Re: Buffer Overruns only when purging events

Post by Steveearle86 »

Thanks bbunge,
I will try tonight and report back.

I have been thinking, the processor is a quad-core so in theory, a load of 2.5 shouldn't be an issue which I find confusing, I am wondering if Disk I/O maybe an issue, with RAID 0 as a possible solution.
User avatar
knight-of-ni
Posts: 2406
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Buffer Overruns only when purging events

Post by knight-of-ni »

A failing disk can cause this.

Try watching your disk i/o while the problem is occurring. Also see if anything shows up in your system log.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
Steveearle86
Posts: 16
Joined: Wed Oct 28, 2015 1:19 pm

Re: Buffer Overruns only when purging events

Post by Steveearle86 »

I have been playing with mysql tuner and it said that my query cache was disabled. I have added the following to /etc/mysql/my.cnf


query_cache_type = 1
query_cache_size = 2048M
query_cache_limit = 1024M

I will monitor and see what happens.

I have just noticed however, whenever I delete a number of events, say, 20, the zoneminder web page becomes unresponsive and "waiting for localhost/zm" I wonder if this could be an Apache issue?
Steveearle86
Posts: 16
Joined: Wed Oct 28, 2015 1:19 pm

Re: Buffer Overruns only when purging events

Post by Steveearle86 »

Thanks everyone for your help.
It's been a while since I posted but I have made a few changes which seem to have rectified the issue.

-I did a clean install of Ubuntu from scratch(for another reason) which generally seemed to make Zoneminder perform better. There was not as many dropped frames causing rogue events but there were some still (When deleted events or not)
-Swapped my storage hard disk for a brand new one (old disk was giving I/O errors)
-At this point one camera was dropping frames, the other seemed solid so I factory reset the offending camera and all seemed solid at this point - 7 days without a dropped frame on either camera and therefore no extra events
-Doubled the RAM from 4GB to 8GB for good measure
Locked