zoriya / Kyoo

A portable and vast media library solution.
https://kyoo.zoriya.dev
GNU General Public License v3.0
1.75k stars 42 forks source link

API uses lots of CPU by default and requires a CPU limit on docker-compose/kube #448

Open zoriya opened 6 months ago

zoriya commented 6 months ago

Kyoo's version

4.5.0

What happened?

To trace this, last time I checked it was because the aspnet runner was creating threads since requests were queuing up. I tried to set a thread count limit, but it did not work, and I simply set a CPU limit on docker compose.

We should look into:

felipemarinho97 commented 5 days ago

It is using a lot of memory too, 4GB in my system.. it cannot even start if I set a limit

felipemarinho97 commented 5 days ago

Sometimes it cannot even respond on the port, and cloudflare (my proxy) starts returning 502. By looking at the logs seems that backend is busy downloading thumbnails:

back-1              | [17:42:49 INF         ThumbnailsManager (0316213321)] Downloading image The thumbnail of thelma
back-1              | [17:42:49 INF         ThumbnailsManager (0316213321)] Downloading image The poster of lawrence-of-arabia
back-1              | [17:42:50 INF         ThumbnailsManager (0316213321)] Downloading image The logo of the-substance

If the backend was in some other language like golang or python maybe I could help... but I don't know C# nor do I have the tools to run the project.

zoriya commented 5 days ago

the backend is being completely rewritten (in js). see #597 for more details.