nichobi / sponsorblockcast

A shell script that skips sponsored YouTube content on all local Chromecasts
GNU General Public License v3.0
348 stars 15 forks source link

High CPU Usage #28

Open calvinbui opened 1 year ago

calvinbui commented 1 year ago

Once a day, the CPU usage goes nuts.

❯ docker logs -f sponsorblockcast
watching 8882c3689d9d4015f9da87632e747d02, pid=21
watching e4350b1100306f683bced1b48418e7a5, pid=26
watching 43d81f1432ac1ae06300f612ecf9b86f, pid=35
watching f27bf7c6cd3681996beb8ffd507f2bb8, pid=48
watching 78956832eaeedd3be79533d152062fa4, pid=53
watching 8df2b3780518693696678c8f5d76207d, pid=58
watching 4f7fea885c105fc1f436138b2f1ad9ce, pid=63
Skipping skippable ad
error: unable to skip current ad: No ad detected, there is nothing to skip
Skipping skippable ad
error: unable to skip current ad: No ad detected, there is nothing to skip
Skipping skippable ad
error: unable to skip current ad: No ad detected, there is nothing to skip
Skipping skippable ad
error: unable to skip current ad: No ad detected, there is nothing to skip
Skipping skippable ad
error: unable to skip current ad: No ad detected, there is nothing to skip
Skipping skippable ad
error: unable to skip current ad: No ad detected, there is nothing to skip
watching e4350b1100306f683bced1b48418e7a5, pid=22
watching 8882c3689d9d4015f9da87632e747d02, pid=27
watching f27bf7c6cd3681996beb8ffd507f2bb8, pid=36
watching 78956832eaeedd3be79533d152062fa4, pid=45
watching 43d81f1432ac1ae06300f612ecf9b86f, pid=55
watching 4f7fea885c105fc1f436138b2f1ad9ce, pid=64
watching 8df2b3780518693696678c8f5d76207d, pid=77
Skipping skippable ad
error: unable to skip current ad: No ad detected, there is nothing to skip
Skipping skippable ad
error: unable to skip current ad: No ad detected, there is nothing to skip
watching e4350b1100306f683bced1b48418e7a5, pid=188136
watching 8882c3689d9d4015f9da87632e747d02, pid=188144
watching f27bf7c6cd3681996beb8ffd507f2bb8, pid=188157
watching 78956832eaeedd3be79533d152062fa4, pid=188172
watching 8df2b3780518693696678c8f5d76207d, pid=188199
watching 4f7fea885c105fc1f436138b2f1ad9ce, pid=188208
Skipping skippable ad
error: unable to skip current ad: No ad detected, there is nothing to skip
Skipping skippable ad
error: unable to skip current ad: No ad detected, there is nothing to skip

image

Deathproof76 commented 1 year ago

Running as an addon in Home Assistant OS on an x64 system with added YT api key. I seem to have similar issues. Didn't use Youtube in the last 60 minutes since I rebooted the server and cpu-usage seems to stay high until I restart the sponsorblockcast container.

grafik

grafik

NeodymiumPhish commented 1 year ago

Experienced the same thing on my UnRAID server. Thought the issue was another Docker container until checking htop. It ran at 90%+ CPU utilization for a couple days because I had an ongoing task I didn't want to cancel and assumed the CPU usage was caused by that.

SteveDinn commented 1 year ago

+1 Just came into my office and heard the fans in my server going crazy. Checked htop and found this:

image

It's been running for a couple of hours, and I don't think anybody has used YouTube on a Chromecast since I started it up. Here are the docker container logs:

Attaching to sponsorblockcast_app_1
app_1  | watching 54ffe223479315909a673b9acb0433c1, pid=23
app_1  | watching 597e0f5f36fe8127107ff0e974d8dba4, pid=28
app_1  | watching cd6d060e684be93a96a2b453cfa3b223, pid=44
app_1  | watching d6fe70190f9e68baa09bd28a153eb9aa, pid=49
app_1  | watching aebc65f445f83d925e19689db1a03b37, pid=68
app_1  | watching 842783d9773bc5865b780e1b4d5a81b8, pid=73
app_1  | watching cca184d8ad1a0e7822cc01dd96df7070, pid=88
app_1  | watching e917af73ca4e811ae818c81e4c57357e, pid=94
app_1  | watching c3373bd1bedc3cb90bc846406f908d97, pid=101
app_1  | watching 1c53846937c98610a8ba8e4df0dfd293, pid=113
app_1  | watching 80ac793ea05642e69582683f1e9c83e8, pid=128
app_1  | watching 85a6c8d8e464aa69ea6e19b582dc2996, pid=138
app_1  | watching 00ce76e1914db6d4b854c7c0ed4a3c77, pid=148
app_1  | Skipping skippable ad
app_1  | error: unable to skip current ad: No ad detected, there is nothing to skip
app_1  | Skipping skippable ad
app_1  | error: unable to skip current ad: No ad detected, there is nothing to skip
app_1  | Skipping skippable ad
app_1  | error: unable to skip current ad: No ad detected, there is nothing to skip
app_1  | Skipping skippable ad
app_1  | error: unable to skip current ad: No ad detected, there is nothing to skip
app_1  | Skipping skippable ad
app_1  | error: unable to skip current ad: No ad detected, there is nothing to skip
app_1  | Skipping skippable ad
app_1  | error: unable to skip current ad: No ad detected, there is nothing to skip

As nice as it would be to have no youtube ads, this server is used for other things too.

ealexa6 commented 1 year ago

Same issue here. Using synology 920+, no API key and randomly getting 90%+ CPU usage when not being used. It returns to normal for a couple days by restarting container, but then happens again. I'm probably going to have to turn this off for now until there's a fix.

jine commented 1 year ago

Can confirm this issue too.

warieon commented 1 year ago

Hi all, On my Unraid Server, I have a workaround where I have implemented a User Script that is configured to run hourly to "docker restart sponsorblockcast"

In doing so, it's clearing the caching / data build up issue in the script as this is cleared when the script is restarted.

Could also be scheduled and run regularly on other server OS too.

Not a solution to the problem, but since a solution may not come, this at least works around the problem and allows me to continue to benefit from the script (which is awesome!)

bruvv commented 1 year ago

I updated the chromecast-go package and packed it in a new release that you can find here: https://github.com/bruvv/sponsorblockcast/pkgs/container/sponsorblockcast

terrycalderbank commented 1 year ago

Logged into Proxmox and noticed one of the VM cpu usage was 97-100%. Ran top and sure enough it was 5-6 instances of this container. It's handy, but not that handy. I'll stay posted for updates.

bruvv commented 1 year ago

@terrycalderbank would be very useful to know which repo you're running

RichyFreeway commented 1 year ago

@bruvv I've just switche to your repo to see if it makes any difference. Have had this high cpu usage problem for a while. Using an API Key.

terrycalderbank commented 1 year ago

@bruvv Also switched to your fork for now. Will let you know if the CPU usage is better

RichyFreeway commented 1 year ago

@bruvv It's been working so well I'd forgotten to let you know until @terrycalderbank posted and I got a notification.

Hasn't gone wrong once in the 2 weeks, compared to multiple times a day before the switch.

gabe565 commented 1 year ago

I saw similar issues with sponsorblockcast, so I wrote my own version in Go! It's much lighter since it can run all of the go-chromecast watchers in a single process. If anybody is curious, check out gabe565/CastSponsorSkip. See my differences from sponsorblockcast documentation for more info.

nichobi commented 1 year ago

I saw similar issues with sponsorblockcast, so I wrote my own version in Go!

Nice, very good work! I've been hoping for a version using the go-chromecast library directly, but I wasn't going to learn Go for it myself. I look forward to trying it out!