High CPU usage

Forum for questions and support relating to 1.35.x development only.
xefil
Posts: 46
Joined: Wed Jul 19, 2017 1:30 pm

High CPU usage

Post by xefil » Mon Mar 22, 2021 9:59 pm

Hi all,
I'm using ZM 1.35 on Debian server (as soon I can login, I can provide more informations).
I'm noticing a very high cpu usage, I cannot login to the mini-server anymore.
I would like to know some hints to debug the root cause (ZM itself, HDD, MySQL [external], ...).
All started as soon I've enabled some new cams, but actually I'm not able to stop the zm. In addition I've updated the system and some settings, so it's difficult to identify the causes. So some questions to start:

- as soon I'm able to login to the server, is there a command / way to disable all cams and let me start the service again and enable the cams one-by-one again?

- is there a way to debug what exactly creates so high cpu usage?

- is there a command to share with you a summary of the common settings I've applied to in case identify what could cause those issues, if they are related to the software of course

- is there a way to calculate the appropriate hardware to handle 6 cams? they should be all 720p, but actually I'm not able to check it due it's freezed.

Any suggestion is really appreciated!

Thanks, Simon

dougmccrary
Posts: 163
Joined: Sat Aug 31, 2019 7:35 am

Re: High CPU usage

Post by dougmccrary » Tue Mar 23, 2021 6:21 am

1.35.what? There have been big changes since 1.35.x was started.
You should either go back to a release version - 1.34.23 as I write, or if you want to stick with 1.35. (development version subject to breakage) I suggest you reinstall, add one camera, and then read up on it. For instance, "buffers" should be set at 2, rather than 20 or more in the present release version.

xefil
Posts: 46
Joined: Wed Jul 19, 2017 1:30 pm

Re: High CPU usage

Post by xefil » Tue Mar 23, 2021 8:55 am

good morning,
Right now I was able to login and shutdown the process.
Here some informations:

ZM: 1.35.21~20210316095022-focal
OS: Ubuntu 20.04.2 LTS

Is a downgrade possible from a 1.35 version?
I would stay on 1.35 if possible.

Then what about the other questions? Now I've the problem that as soon I start ZM, it hangs, so it would be great if it's possible start it in SAFE MODE or a way to disable CAMS before I start the process. From MySQL i.e.?

Thanks, Simon

PS: Menahwile I'm updating to 1.35.21~20210322213116-focal due it's on available updates :-)

dougmccrary
Posts: 163
Joined: Sat Aug 31, 2019 7:35 am

Re: High CPU usage

Post by dougmccrary » Tue Mar 23, 2021 9:15 am

Desktop or server? I find a monitor useful.
Anyway, unless your cameras are hard to set up, probably just drop the monitor table. Or back it up first.
If all the cams are very similar, it's pretty easy after the first to just clone the first and change the IP.
Maybe even easier to disable the cams temporarily, depends....

xefil
Posts: 46
Joined: Wed Jul 19, 2017 1:30 pm

Re: High CPU usage

Post by xefil » Tue Mar 23, 2021 9:33 am

Uh all server with SSH. But pointing me to the Monitor Table is a good starting point. I'll look into it to check if there is an "ENABLE" fiels. I've 3 different cams and 2 of them with linked monitors so I would like to prevent in deleting all ;)
I'll let you know!
Thanks, Simon

User avatar
iconnor
Posts: 1494
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: High CPU usage

Post by iconnor » Tue Mar 23, 2021 1:11 pm

Update monitors Set Function='None';

xefil
Posts: 46
Joined: Wed Jul 19, 2017 1:30 pm

Re: High CPU usage

Post by xefil » Tue Mar 23, 2021 1:47 pm

Thanks @iconnor!

Meanwhile, @dougmccrary, which buffer should I change?

Actually I have:

Image Buffer Size (frames) 15
Warmup Frames 20
Pre Event Image Count 10
Post Event Image Count 10
Stream Replay Image Buffer 0
Alarm Frame Count 3

If I could export all settings to a fast analysis I would do it, or in case let me know which settings are most CPU affecting.
In this moment I've 1.4load which is great, but after some time it goes back to 4 and higher and higher.

Thanks!

Simon

dougmccrary
Posts: 163
Joined: Sat Aug 31, 2019 7:35 am

Re: High CPU usage

Post by dougmccrary » Tue Mar 23, 2021 11:50 pm

Image Buffer Size (frames) 15 =-> 2

xefil
Posts: 46
Joined: Wed Jul 19, 2017 1:30 pm

Re: High CPU usage

Post by xefil » Wed Mar 24, 2021 9:43 am

Thanks @dougmccrary, I'm correcting those values right now. But should this not only affect memory usage

What about the approach to record all on main-stream in pieces and let trigger the motion on the low-res view as posted here?

viewtopic.php?f=9&t=27537

Does it make sense or is the same result as in using linked monitors?

Thanks, Simon

Cramac1
Posts: 76
Joined: Wed Aug 29, 2018 11:29 am

Re: High CPU usage

Post by Cramac1 » Fri Mar 26, 2021 6:47 pm

I have not updated it for a long time and here on you. It was 1.35.16, updated to 1.35.21. After restarting, all three servers immediately hung up. Somehow I managed to stop the zoneminder and the server returned to normal. Disconnected all cameras, launched ZM, all the rules. I start to turn it on, after 2-3 cameras, the server starts to respond for a very long time.

I will assume that the problem is in cameras with sound.

Cramac1
Posts: 76
Joined: Wed Aug 29, 2018 11:29 am

Re: High CPU usage

Post by Cramac1 » Fri Mar 26, 2021 8:06 pm

empirically found that the new version began to use much more RAM, reducing the buffers, the systems sagged.

xefil
Posts: 46
Joined: Wed Jul 19, 2017 1:30 pm

Re: High CPU usage

Post by xefil » Sun Mar 28, 2021 1:00 pm

Hello,
I was thinking the issue is on two cameras which are handling only one stream per time and sometimes it's not reachable. But I have two cams with audio too, so I'll try to shutdown those cams as well and let you know.
The idea to register in chunks the cams always sounds good BTW, so the script is an Idea I would like to check anyway, but a stream that identifies the moves is needed anyway, otherwise I'll handle them only without MoDect, but in such a case I would not use the advantages of ZM.
Hmmmmm... what to do.... :)

dougmccrary
Posts: 163
Joined: Sat Aug 31, 2019 7:35 am

Re: High CPU usage

Post by dougmccrary » Mon Mar 29, 2021 5:50 am

"Hmmmmm... what to do.... "

Play with it!
I have mostly pretty low res cams and run them at 5fps, modect, and don't have any problems that bother me at the moment.
I do sort of wish they'd made a release of this version a few weeks ago when it was pretty stable, though.

Good luck. :D

xefil
Posts: 46
Joined: Wed Jul 19, 2017 1:30 pm

Re: High CPU usage

Post by xefil » Tue Apr 06, 2021 9:44 am

Hello,
I've seen I cannot play with FPS settings on the cams. It's possible to do that in ZM side?
Now having the cams with audio disabled (two) and enabled the others (four) the load was 85%. Now, after a service restart, down to 50%

Here history:
- added only 2 cams (tot 2)
- added 2 cams more (tot 4)
- restart ZM (tot 4)
the 2 with audio are still offline.
load.png
load.png (242.86 KiB) Viewed 346 times
Thanks, Simon

dougmccrary
Posts: 163
Joined: Sat Aug 31, 2019 7:35 am

Re: High CPU usage

Post by dougmccrary » Wed Apr 07, 2021 12:02 am

I don't see where you mentioned what the cams are?
What is zm reported fps? Is there more than one stream?

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests