Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CPU Usage Issue #169

Closed
iSkytran opened this issue Jan 19, 2021 · 6 comments
Closed

CPU Usage Issue #169

iSkytran opened this issue Jan 19, 2021 · 6 comments
Labels
API Related to the backend api server written in Go

Comments

@iSkytran
Copy link

I'm currently running Photoview on a laptop in my home. This laptop has approximately 70 GB of photos and videos. Whenever I try to scan my photos and videos however, it will get hung up on a large video. The cpu usage spikes to 100% and eventually the laptop crashes a few seconds later. This is probably due to me running Photoview on an underpowered laptop, but are there any other solutions?

@viktorstrate
Copy link
Member

There is a discussion about ways the video scanner could be improved or disabled to reduce CPU and cache size, see #131.

But for now you can try to set Scanner Concurrent Workers to 1 in the Settings page. This will limit processing to one item at a time.

@iSkytran
Copy link
Author

Unfortunately, while lowering the Scanner Concurrent Workers to 1, it just delayed the inevitable and the laptop still crashed. The video it is getting hung up on is 404 MB large which is likely a part of the problem? I'll try limiting the docker next cpu usage to prevent the computer from crashing, so I'll see how that goes.

@viktorstrate
Copy link
Member

Okay, I'll give this issue a high priority. I'm thinking a simple solution would be to add the option to disable video transcoding completely from the settings.

Also only transcode videos that cannot be played in the browser, see also #131 (comment)

@viktorstrate viktorstrate added the API Related to the backend api server written in Go label Jan 24, 2021
viktorstrate added a commit that referenced this issue Jan 27, 2021
This relates to the following issues #131 #169 #173
@viktorstrate
Copy link
Member

The scanner will now only transcode videos that aren't web compatible.
See commit fbebb13.

If you are using the :edge docker tag, you can pull the latest changes, if so do you mind checking if this solves your problem?

@iSkytran
Copy link
Author

The changes definitely helped! The computer got further along before crashing, so I believe that it's a hardware problem, but putting a CPU limit in the docker-compose file seemed to prevent the CPU from spiking about 90 degrees Celsius. I just added

deploy:
 resources:
    limits:
        cpus: "2"

and ran docker-compose with docker-compose --compatibility up -d.

Thanks for making such a cool piece of software!

@viktorstrate
Copy link
Member

Great to hear that you found a solution and that the changes helped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Related to the backend api server written in Go
Projects
None yet
Development

No branches or pull requests

2 participants