TheWicklowWolf / LidaTube

Find and download missing Lidarr albums via yt-dlp.
GNU General Public License v3.0
84 stars 6 forks source link

On Unraid Thread_Limit doesnt seem to affect resource usage. #30

Closed DalaraAFL closed 2 weeks ago

DalaraAFL commented 2 weeks ago

Hey, i have thread limit set to 16 on unraid, however it never seems to use more than 1 cpu core. I dont have any cpu pinning or isolation setup for the docker container. Im using the docker container under thewicklowwolf/lidatube:latest.

This isnt a major issue for me tbh, just slows things down, so im going to have to run it a bit longer.

The tools amazing, and thanks for your work!

TheWicklowWolf commented 2 weeks ago

Hey, i have thread limit set to 16 on unraid, however it never seems to use more than 1 cpu core. I dont have any cpu pinning or isolation setup for the docker container. Im using the docker container under thewicklowwolf/lidatube:latest.

This isnt a major issue for me tbh, just slows things down, so im going to have to run it a bit longer.

The tools amazing, and thanks for your work!

Are you sure you're using the correct environment variable? You should be able to see in the logs if multiple actions are happening simultaneously.

Also, keep in mind that it runs multithreaded, not multiprocess, so it will only use a single ~CPU core~ process but may use multiple cores (depending on you machine).

It could also be related to how it's set up on Unraid, but since I'm not running, I can't say.

DalaraAFL commented 2 weeks ago

Hey, I didnt realize in python multi threading is locked to a single core (unless you go through converting to multiprocessing).

to be honest im not entirely sure i understand the point of multi threading a cpu bound application, if it is still stuck to the single cpu core... usually when theres an environment variable to turn up thread count it is to take advantage of multiple cpu cores.

Thanks for the response, it would be nice for this to support full multi threading, but it sounds like that would be a more significant time investment than just fixing a bug :p

TheWicklowWolf commented 2 weeks ago

I didnt realize in python multi threading is locked to a single core

It's not locked to a single core but rather a single process as threads can be spread across multiple cores (depending on your hardware).

This isn’t a CPU-bound application, so multithreading is highly effective and makes perfect sense in this context. Additionally, even with multithreading, the system can still be worked quite hard due to the nature of the tasks involved.

Given this, the issue you’re encountering is more likely related to your Unraid setup or a configuration setting within your environment, rather than being a problem with the application itself.

I’ll close this issue for now since it’s not a bug.