My main server is an older Phenom II quad core 3.2Ghz with 8G of ram.
6 SATA drives, with a software RAID1 root partition. and a software RAID5 data partion.
Teh test machine was a 2 core 3Ghz Phenom II with 8G or ram, and a single 500G SATA drive.
Both are X64 Arch Linux Distro machines.
When running a single H264 based camera, the CPUs sit at about 30%, and the Disk IO sits about below 20% as well.
I have my suspicions that it's a disk IO problem, but I'm not convinced. I also suspect MySQL has some blame, but also not totally convinced.
Currently I have my ZM (1.28.1) setup with a link to a single outdoor camera. It's a H264 3MP camera setup to stream only 10fps.
ZM has no trouble reading the camera using ffmpeg. the live view mode looks perfect, an no frames are missing.
ZM is setup with just a simple "AlarmPixles' zone to watch for motion. It seems to pick up motion just fine.
If i trigger a web-based force alarm, or if it detects motion, the frames recorded quickly drops from 10fps down to about 5fps.
It starts out decent recording about 2 seconds at 10fps, but by the time it's into the alarm frames, its' down to 5fps and never recovers.
But... if I switch the camera to "Record", it gets every single frame without fail. I set it churn on Record for about 10 minutes, and it captured every single frame no problem. Not one missed. Which tells me, its' capable of capturing the frames, but something is going wrong when in Modect mode.
The camera as 2 aux streams, I tried setting up a MJPG aux stream at 704x572 and 10fps. I setup a 2nd monitor and set it up as the alarm trigger for the other main stream.
It did better.. much better.. but still dropped frames. Both the lower res MJPG stream and the main X264 stream dropped about the same frames. On average both managed between 6-9fps. Some short 10fps runs also. But.. still not the perfect 10fps that "Record" manages.
I know software raid isn't awesome, but I've never had an issue with it's IO.
Running a simple IO test on my drives.
Code: Select all
dd if=/dev/zero of=tmp.img bs=1G count=1 oflag=dsync
And a less than ideal 40-50MB/s on my root drive.
I've tried moving the mysql files to a stand alone SATA partition, and it didn't seem to make any improvement.
Iv'e tried tweaking various innodb values in my.conf to increase performance, but it didn't seem to help.
I have a gigabit homenetwork, so I even tried hooking ZM to a a MySQL database on my Laptop (i7, 32G ram, SDD disk) but it made no difference.
One thing I notice though, is the mysql database on my main machine really doesn't seem snappy. It takes almost 4x as long to run the zm_create.sql on it as it does on my test machine.
So.... my guess is ZMA has something to do with this. Is it somehow failing to tell ZMC to capture various frames? The reason I suspect ZMA is really just because when it's removed from the equation (Record mode) I get every frame.
I do get the usual share memory warnings in my log file, but I don't know if that is the cause.
Code: Select all
ZMU - Shared data not initialised by capture daemon, some query functions may not be available or produce invalid results for monitor FrontYard
Any insight on what to look for ?
Cheers
Shane