High Mysql and Apache load when camera can not be contacted

Forum for questions and support relating to the 1.32.x releases only.
Post Reply
flixter
Posts: 4
Joined: Fri Jul 19, 2019 7:18 am

High Mysql and Apache load when camera can not be contacted

Post by flixter »

I have a computer serving 1 camera, connected by USB to it, to ZoneMinder (the idea is to use, later, a Raspberry Pi with 5 cameras). I have coded a C++ app that reads the camera and publishes it as a REST service for ZoneMinder (so that I am using the Remote-HTTP source for that camera). In case is relevant: Because of the REST library I'm using, restbed, I can not easily serve (still working on it) multipart images, so at every call of http://xx.xx.xx.xx/cameras/0 I get a single jpeg image.

What happens is the following: If for some reason the camera is down, and I'm seeing the life feed, Apache starts spawning threads. Also, CPU usage due to Mysql sky-rockets... all of it boiling down to system load going well above 15 on a 2 core machine.

Is this expected behavior, or do I have a setting miss-configured somewhere?

Thank you!
User avatar
iconnor
Posts: 2881
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: High Mysql and Apache load when camera can not be contacted

Post by iconnor »

Turning off database logging may help with the mysql load. Otherwise, if a camera is down, stop trying to watch it. That will stop the apache spawning.
flixter
Posts: 4
Joined: Fri Jul 19, 2019 7:18 am

Re: High Mysql and Apache load when camera can not be contacted

Post by flixter »

Will give it a try. Thank you :)
Post Reply