Lots of Event

Discussions related to the 1.36.x series of ZoneMinder
Post Reply
Wo0t
Posts: 7
Joined: Fri Nov 25, 2022 11:30 am

Lots of Event

Post by Wo0t »

Hi!
after i update zoneminder to v1.36.32 i've got lots of 1fps events.
Server MySQL got lots of write I/O to SSD drive - 100%

When i set MaxImageBufferCount to 0

One of camera eating 80% of my memory RAM
and my server just crash

My server:

Code: Select all

i7-2600K
32 GB DDR3
Ubuntu 20.04
Php 8.1 
MySQL 8
Camera Settings:

Code: Select all

Source Path rtsp://admin:XXXX@192.168.100.74:554/cam/realmonitor?channel=1&subtype=0
Capture Resolution (pixels) 2688x1520 4MP @ 15fps
Fuction Mocord
Save JPEGs analisys Images only 
ImageBufferCount 3
MaxImageBufferCount 100
Pre / Post Event Image Count 5
Alarm Frame Count	1
Estimated Ram Use	Min: 124.75MB Max: 1.625GB

Code: Select all

25/11/2022, 12:43:34	zmc_m7	Master	1271884	INF	Dahua - Prawa: 54681 - Closing event 257820, section end forced 1669376608 - 1669372969 = 3639 >= 600	zm_monitor.cpp	1911
25/11/2022, 12:43:34	zmc_m7	Master	1271884	INF	Dahua - Prawa: 45822 - Opened new event 257820, section start	zm_monitor.cpp	1937
25/11/2022, 12:43:33	zmc_m7	Master	1271884	INF	Dahua - Prawa: 54671 - Closing event 257819, section end forced 1669376607 - 1669372969 = 3638 >= 600	zm_monitor.cpp	1911
25/11/2022, 12:43:33	zmc_m7	Master	1271884	INF	Dahua - Prawa: 45821 - Opened new event 257819, section start	zm_monitor.cpp	1937[

25/11/2022, 13:02:29	zmc_m7	Master	1322747	WAR	You have set the max video packets in the queue to 100. The queue is full. Either Analysis is not keeping up or your camera's keyframe interval 0 is larger than this setting.	zm_packetqueue.cpp	136
i change Section length from my 300 to default 600 and
FILTER_RELOAD_DELAY - 300 > 600
MAX_RESTART_DELAY - 600 > 1200

sometimes on record video when detectd move screen is freezeing and got green or the picture smudges.
dougmccrary
Posts: 1172
Joined: Sat Aug 31, 2019 7:35 am
Location: San Diego

Re: Lots of Event

Post by dougmccrary »

Do you know what the camera keyframe interval is?
Can you change it?
Wo0t
Posts: 7
Joined: Fri Nov 25, 2022 11:30 am

Re: Lots of Event

Post by Wo0t »

Unfortunately, this value in cameras is unknown to me. I am unable to change it. Unless someone knows where it can be in the Dahua camera settings?
dougmccrary
Posts: 1172
Joined: Sat Aug 31, 2019 7:35 am
Location: San Diego

Re: Lots of Event

Post by dougmccrary »

Don’t know about Dahua, but some give lots of settings at http://<ipaddress>
User/password will be what ZM uses.
Magic919
Posts: 1381
Joined: Wed Sep 18, 2013 6:56 am

Re: Lots of Event

Post by Magic919 »

I’d set a number for MaxImageBufferCount other than zero. That’ll stop it running away with memory and should stop the crashing.
-
Wo0t
Posts: 7
Joined: Fri Nov 25, 2022 11:30 am

Re: Lots of Event

Post by Wo0t »

I have set MaxImageBufferCount to 100 and the RAM memory does not exceed 2GB per camera.
If I set it to unlimited one camera uses more than 80% of RAM. but if I turn off the rest of the cameras (I have four) then the server works and there are no problems with a large number of events and records in MySQL.

but there is still a problem.
You have set the max video packets in the queue to 100. The queue is full. Either Analysis is not keeping up or your camera's keyframe interval 0 is larger than this setting. zm_packetqueue.cpp 136
no matter how much I set it, the error still appears. The exception is only when there is no limit for RAM memory. Then this error does not appear

I logged into the cameras and I can't set the keyframe in any of them.

Camera Settings:
Source Path rtsp://admin:XXXX@192.168.100.74:554/cam/realmonitor?channel=1&subtype=0
Capture Resolution (pixels) 2688x1520 4MP @ 15fps
Fuction Mocord
Save JPEGs analisys Images only
ImageBufferCount 3
MaxImageBufferCount 100
Pre / Post Event Image Count 5
Alarm Frame Count 1
Estimated Ram Use Min: 124.75MB Max: 1.625GB
Magic919
Posts: 1381
Joined: Wed Sep 18, 2013 6:56 am

Re: Lots of Event

Post by Magic919 »

Try setting the analysis FPS somewhat lower than 15.
-
Wo0t
Posts: 7
Joined: Fri Nov 25, 2022 11:30 am

Re: Lots of Event

Post by Wo0t »

I change analysis FPS to 10 and change from monitor to mocord again

few moments later...
Image
and look at memory RAM use...
Image
and this is my buffers setting
Image
any suggestions? why is soo lots of events?
Magic919
Posts: 1381
Joined: Wed Sep 18, 2013 6:56 am

Re: Lots of Event

Post by Magic919 »

No idea.
-
Wo0t
Posts: 7
Joined: Fri Nov 25, 2022 11:30 am

Re: Lots of Event

Post by Wo0t »

what do I mean by that?
Closing event 259675, section end forced 1669593559 - 1669592081 = 1478 >= 600
dougmccrary
Posts: 1172
Joined: Sat Aug 31, 2019 7:35 am
Location: San Diego

Re: Lots of Event

Post by dougmccrary »

Closing event 259675, section end forced 1669593559 - 1669592081 = 1478 >= 600
1669...is the time in seconds since 1970-01-01 00:00:00 UTC - it's how *nix (unix, linux) tell time.
So it's saying you have the event length at 600 secs but it went over to 1478 secs. You'll notice you have several events overlapping in time -
I don't pretend to understand how that happens, but it seems to mean something is changing in the image from frame to frame(s).
If you just turn of detection, does the camera record OK that way? Is it a clean/clear live image and recording? Look closely.
If it's clean, I suggest you try making the image buffer 500 or so, turn jpegs off, and turn detection back on. Any better?
Wo0t
Posts: 7
Joined: Fri Nov 25, 2022 11:30 am

Re: Lots of Event

Post by Wo0t »

After a few days of testing. It's better, but cameras still use huge amounts of RAM.

When I set the Record mode, the cameras record one event at a time, but sometimes something like this happens...

Image

Code: Select all

Buffers setting:
Image Buffer Size (frames) - 5
Maximum Image Buffer Size (frames) - 150
Warmup Frames- 0
Pre Event Image Count - 5
Post Event Image Count - 5
Stream Replay Image Buffer - 0
Alarm Frame Count - 1
Estimated Ram Use	Min: 155.875MB Max: 2.375GB


Analysis FPS - 5
Save JPEGs - Disabled
Video Writer - Camera Passthrough
Source from Camera:
2688x1520@10fps


I have this in the kernel logs.

Code: Select all

Dec  4 16:04:44 Host kernel: [934470.922943] oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=/,mems_allowed=0,global_oom,task_memcg=/system.slice/zoneminder.service,task=zmc,pid=4173405,uid=33
Dec  4 16:04:44 Host kernel: [934470.922960] Out of memory: Killed process 4173405 (zmc) total-vm:17528096kB, anon-rss:15693204kB, file-rss:868kB, shmem-rss:79808kB, UID:33 pgtables:33012kB oom_score_adj:0
Dec  4 16:04:44 Host kernel: [934473.938446] oom_reaper: reaped process 4173405 (zmc), now anon-rss:0kB, file-rss:0kB, shmem-rss:79808kB
Dec  4 16:05:31 Host e of uninitialized value $cpuload[0] in join or string at /usr/bin/zmdc.pl line 316.
Dec  4 16:05:31 Host e of uninitialized value $cpuload[1] in join or string at /usr/bin/zmdc.pl line 316.
Dec  4 16:05:31 Host e of uninitialized value $cpuload[2] in join or string at /usr/bin/zmdc.pl line 316.
Then I switched to Mocord mode... and it started...
See how many events are in the Days column

Image

Image

We changed the server. Reinstalled Zoneminder and no changes.

Zoneminder is now useless. Even a 12-core Xeon with 64 GB RAM can kill.
The entire server is no longer stable.
One camera can use more than 30 GB of RAM!
dougmccrary
Posts: 1172
Joined: Sat Aug 31, 2019 7:35 am
Location: San Diego

Re: Lots of Event

Post by dougmccrary »

How do you have a server column in your console page?
Wo0t
Posts: 7
Joined: Fri Nov 25, 2022 11:30 am

Re: Lots of Event

Post by Wo0t »

I am using the multiple server option and this column was visible without any changes in console page
Post Reply