CPU usage surges when running as service

Post Reply
n4mwd
Posts: 8
Joined: Thu Feb 22, 2024 12:39 pm

CPU usage surges when running as service

Post by n4mwd »

I have recently purchased and installed BI on my computer. So far, most everything seems to be working OK. However, when I clicked the box to run it as a service, the CPU utilization skyrocketed. Why is this and what can be done to fix it?

My system:
Win 11.
intel i5-1235U CPU w/12 cores/threads running at 2.5 GHz according to speccy.
The CPU has a built in GPU.
16G RAM.

11 IP Cameras mostly 4MP all wired and connected to a VLAN and private unmanaged switch.
All cameras output H.264 except for one which only does H.265.
The BI box is also part of the VLAN and all are denied internet access but still have local LAN access.
The BI box and all the cameras are set to use the Time Server in the router so they all have accurate time and are in sync.

With this setup, running as a program from the windows desktop, the CPU utilization is about 3%. It makes no difference if I am using the web interface.

When I click "run as service" and reboot, the CPU jumps to 12% with no console or web connection. When the console is started, the CPU jumps to 25%. When connected to the web interface as well, it jumps to 30%.

This is easily repeatable so if I uncheck "run as service", reboot and restart BI, the CPU falls back to 3%.

I tried unchecking "start as service" and then putting it in Task Scheduler to automatically start at bootup, but it seems to start it as a service anyway because the UI never came up. I haven't tried putting it in the Startup folder because I was concerned something might stop it from loading.

I also have Direct to Disk and Intel+Vpp selected.

Is this something that can be fixed or worked around? I would like to add AI detection later which will need a lot of CPU% just for that which is why I want to keep the non-AI part of BI running as low CPU% as possible.
louyo
Posts: 166
Joined: Sat Apr 18, 2020 1:16 am

Re: CPU usage surges when running as service

Post by louyo »

I am running 14 cameras on W10 with a moderate system. I run BI as a service and use AI installed on another system. All cameras are set up to are set for 1080P (even the 4K) and use substreams, a huge difference on cpu.
With the BI console closed and 3 computers using the UI to monitor, and all cameras set to record substream plus alerts, it get 10-13% BI cpu
With the BI console opened, it goes to 25-30% depending on alerts and such. We get a lot of alerts. I only open the console to make changes.
Sounds to me that you are seeing normal operation for your setup.
User avatar
TimG
Posts: 2181
Joined: Tue Jun 18, 2019 10:45 am
Location: Nottinghamshire, UK.

Re: CPU usage surges when running as service

Post by TimG »

Weird, cpu went down when I first set BI5 to a service, which made sense as there was no GUI to display. Are you using sub-streams ? If so try turning off Intel+Vpp and check if cpu loading goes up, down or stays the same, and then try BI5 as a service again.
Forum Moderator.
Problem ? Ask and we will try to assist, but please check the Help file.
n4mwd
Posts: 8
Joined: Thu Feb 22, 2024 12:39 pm

Re: CPU usage surges when running as service

Post by n4mwd »

TimG wrote: Thu Feb 22, 2024 6:18 pm Weird, cpu went down when I first set BI5 to a service, which made sense as there was no GUI to display. Are you using sub-streams ? If so try turning off Intel+Vpp and check if cpu loading goes up, down or stays the same, and then try BI5 as a service again.
I don't think most of the cameras are running substreams. When I installed them, I just entered the camera name in the box and hit the scan button. It used onvif to find everything, but not all of them had a substream detected. I didn't try to find the camera in the list. Still, even with full streams, it was only 3% as an app and a minimum of 12% as a service. I'm wondering if the service is using the GPU properly. Perhaps a bug in windows?

When its only using 3%, as far as I can tell, everything is working properly. I currently have AI installed, but not configured. According to task manager, it is not using any cpu cycles. So its just sitting there for now and isn't part of the 12%.

I have noticed that some times it shows the GPU% down at the bottom next to the CPU%, and other times it is not there.

I will try to change the camera setup to include substreams and see if that makes any difference.
User avatar
TimG
Posts: 2181
Joined: Tue Jun 18, 2019 10:45 am
Location: Nottinghamshire, UK.

Re: CPU usage surges when running as service

Post by TimG »

Back up of PC recommended first. You could also back up BI5 settings too.
Forum Moderator.
Problem ? Ask and we will try to assist, but please check the Help file.
n4mwd
Posts: 8
Joined: Thu Feb 22, 2024 12:39 pm

Re: CPU usage surges when running as service

Post by n4mwd »

TimG wrote: Thu Feb 22, 2024 6:43 pm Back up of PC recommended first. You could also back up BI5 settings too.
I changed all of the camera settings to include a substream option at 640x480. One camera was too cheap to support a substream over ONVIF, but the other 10 seem to be working fine.

I find this hard to believe, but the CPU % when running as a service is back down to 3%. Even with the console up, it stays around 4%. However, the web access does take it up to 7%.

I will accept this as a good workaround. I still don't understand why it makes a difference if its a service or not. My suspicion is that the GPU is not being used when in service mode. The substreams are much smaller than the 4MP images so the CPU doesn't use as many cycles. Still seems like a bug somewhere.
Post Reply