Low processor usage


I have recently moved channels over to a windows virtual on Hyper-V with a Dell T420 and dual Xeons. The VM is ran with 8 cores and 8GB Ram. However when processing and running comskip the processor usage only ever hits 14%. This seems very low and isn't providing the performance gains I had hoped for.

Thanks in advance.

I'm not sure how different Hyper-V is from KVM on Linux or a containerized solution, but that does sound low.

For comparison, I'm running Channels in a systemd-nspawn container (think Docker or LXC). I'm using a roughly 5 year old processor (a Core i3-5010U) with 8GB RAM, no swap (think virtual memory or "page files" in Windows parlance) and Channels uses between 90–100% of a single processor when running comskip with the default settings.

However, 1/8 is roughly ~12%, which may explain your usage. Since your Channels instance thinks there are 8 processors, and only a single processor is used with Channels' default settings, Windows may consider that as only 12% of 100%, rather than the 100% of 800% that many Linux resource displays would show.

You could try setting up an override comskip.ini and experiment with the parameter
;Number of threads used when decoding the video
;;Increasing the thread count speeds up the processing on CPU's with more cores then the current thread count. Setting the number to higher then the amount of cores makes processing slower. Setting the thread_count to 1 disables multi-threaded decoding, useful in case comskip crashes when decoding the video.

I'm guessing if you set it to 4 it will use 50% CPU, 6 would use 75%, etc.

Thanks both. I have found the config file in the logs folder and changed the thread count to 8 as the virtual has 8 cores assigned.

My other thought was that the issue is down to the dual CPUs and Hyper V has allocated 4 cores from each CPU which is causing issues but not sure.

Hopefully one of the channels Devs will be able to help as well.

Changing the ini in the Logs folder will not work. Please refer to the thread above on how to create it in the dvr data directory

Hmm no comskip files in the folder specified. Guide followed.

Correct, you have to create it in there. You can copy the one from Log which you modified

Okay will do that. Does channels need to be rebooted? Also if the VM is assigned 8 cores should the thread count match?

No reboot required.

I would leave atleast one core free for the dvr, and maybe more if other services are running. Probably 4 threads is a good place to start testing.

There is a button on the web UI to rescan commercials in the latest build. To update, click-and-hold on the Check for Update button.

Looks to be working. However now there is more than 1 instance of comskip running.

Does the activity section of the DVR show multiple commercial detections?

Once you have your modified comskip.ini in the data directory, Channels DVR will no longer copy a comskip.ini file into the Logs directory.
You can verify your override comskip.ini settings are being used by looking at the comskip log file in the Logs directory named video.log.

Should be one instance per thread you specified.

4 instances specified. 3 instances showing in task manager

Mine runs on a Synology NAS, I figured in Windows it would be one process per thread specified in the comskip.ini.

Running with thread_count=2 on My Synology NAS I see one comskip Service (50% CPU) and 6 comskip processes.

Interesting. I have tried 4, 6 and 8 in the thread count with channels reboots in-between and the usage now won't go beyond 40%

Comskip forum thread

I'm experimenting with lowres=10 instead of 1, seems to be faster and detect more commercial blocks.
The jury is still out in deliberation.

A typical mpeg2 recording processed by comskip using 2 threads on my quad-core NAS shows the following in the comskip log file video.log

Parsed 170734 video frames and 191949 audio frames at 522.78 fps

This is a 1.5hr HD broadcast at 9 Mb/s (6.18 GB) and took 5 1/2 minutes to comskip using lowres=10..

This is one of the faster comskips on an mpeg2 recording from a PBS station with minimal commercials, so runs quick. The other extreme is an H.264 recording with many commercials and could take up to 30 minutes for a one hour recording.