immich-microservices Container pinning CPU at 100% #90

Closed
opened 2026-02-04 17:31:00 +03:00 by OVERLORD · 23 comments
Owner

Originally created by @darrylgibbs on GitHub (Jun 10, 2022).

Describe the bug
After backing up all photos from my phone, the Microservices container runs at 100% CPU. RAM usage is negligible. The photo library is only 34 images, and the CPU is still pinned 14 hours after initial sync.

Task List
Running in a VM on Proxmox, one of many other docker apps running. Photos are synced to a directory on my NAS (seperate device). CPU is a Interl J4205 (4 cores) and 6GB RAM has been allocated.

To Reproduce
Unknown

Desktop (please complete the following information):

  • OS: Ubuntu 22.04 LTS + Docker
Originally created by @darrylgibbs on GitHub (Jun 10, 2022). **Describe the bug** After backing up all photos from my phone, the Microservices container runs at 100% CPU. RAM usage is negligible. The photo library is only 34 images, and the CPU is still pinned 14 hours after initial sync. **Task List** Running in a VM on Proxmox, one of many other docker apps running. Photos are synced to a directory on my NAS (seperate device). CPU is a Interl J4205 (4 cores) and 6GB RAM has been allocated. **To Reproduce** Unknown **Desktop (please complete the following information):** - OS: Ubuntu 22.04 LTS + Docker
Author
Owner

@alextran1502 commented on GitHub (Jun 10, 2022):

Can you try restarting the application to see if it resolves the problem? I haven't experienced this issue yet

@alextran1502 commented on GitHub (Jun 10, 2022): Can you try restarting the application to see if it resolves the problem? I haven't experienced this issue yet
Author
Owner

@alextran1502 commented on GitHub (Jun 10, 2022):

Can you also provide your phone model and which type of assets did you upload to Immich? might be a special case that I haven't thought out yet?

@alextran1502 commented on GitHub (Jun 10, 2022): Can you also provide your phone model and which type of assets did you upload to Immich? might be a special case that I haven't thought out yet?
Author
Owner

@darrylgibbs commented on GitHub (Jun 10, 2022):

Screenshot 2022-06-10 091747

The CPU usage % jumps rapidly between 100 and 195% constantly, even after restart. I even went as far as deleting the app from my phone, but this continues.

I have a Samsung S8 International model. Photos and H265 video files, directly from the camera folder.

@darrylgibbs commented on GitHub (Jun 10, 2022): ![Screenshot 2022-06-10 091747](https://user-images.githubusercontent.com/9167471/173062585-038e372b-da01-4cf8-b4ca-09b39ba1e29e.png) The CPU usage % jumps rapidly between 100 and 195% constantly, even after restart. I even went as far as deleting the app from my phone, but this continues. I have a Samsung S8 International model. Photos and H265 video files, directly from the camera folder.
Author
Owner

@alextran1502 commented on GitHub (Jun 10, 2022):

@darrylgibbs I was meaning to ask you to restart the server-side, restarting the phone application probably wouldn't do anything.

The increase in CPU usage means that the container is processing the machine learning tasks. But if there is no asset being uploaded, it shouldn't do this. RAM usage should be also moving up and down with the CPU usage as well.

Let's restart the immich containers to see if the issue persists and return in the future.

@alextran1502 commented on GitHub (Jun 10, 2022): @darrylgibbs I was meaning to ask you to restart the server-side, restarting the phone application probably wouldn't do anything. The increase in CPU usage means that the container is processing the machine learning tasks. But if there is no asset being uploaded, it shouldn't do this. RAM usage should be also moving up and down with the CPU usage as well. Let's restart the immich containers to see if the issue persists and return in the future.
Author
Owner

@darrylgibbs commented on GitHub (Jun 10, 2022):

@alextran1502 I did restart the server, all the containers in fact. The results were the same.

I'll restart them now, and leave them for an hour or so and check in on the CPU usage again. That should be a good enough test?

@darrylgibbs commented on GitHub (Jun 10, 2022): @alextran1502 I did restart the server, all the containers in fact. The results were the same. I'll restart them now, and leave them for an hour or so and check in on the CPU usage again. That should be a good enough test?
Author
Owner

@alextran1502 commented on GitHub (Jun 10, 2022):

yes, thank you.

When the container running with the spike, I assume you didn't perform any backup, correct?

@alextran1502 commented on GitHub (Jun 10, 2022): yes, thank you. When the container running with the spike, I assume you didn't perform any backup, correct?
Author
Owner

@darrylgibbs commented on GitHub (Jun 10, 2022):

@alextran1502 correct. I've take no new photos since before first booting up these containers, so there has been nothing new to add.

@darrylgibbs commented on GitHub (Jun 10, 2022): @alextran1502 correct. I've take no new photos since before first booting up these containers, so there has been nothing new to add.
Author
Owner

@alextran1502 commented on GitHub (Jun 10, 2022):

Thank you for the info

@alextran1502 commented on GitHub (Jun 10, 2022): Thank you for the info
Author
Owner

@darrylgibbs commented on GitHub (Jun 10, 2022):

An hour later, usage still high across all 4 cores.

@darrylgibbs commented on GitHub (Jun 10, 2022): An hour later, usage still high across all 4 cores.
Author
Owner

@alextran1502 commented on GitHub (Jun 10, 2022):

Can I assume this is only happen in the VM with other dockers container running? And it wouldn't behave this way if you create a new VM and run Immich on that one?

If this issue only persists in the VM with multiple containers, you can limit the CPU usage of that specific container in the docker compose file

https://stackoverflow.com/questions/59657728/set-cpu-limit-in-docker-compose

@alextran1502 commented on GitHub (Jun 10, 2022): Can I assume this is only happen in the VM with other dockers container running? And it wouldn't behave this way if you create a new VM and run Immich on that one? If this issue only persists in the VM with multiple containers, you can limit the CPU usage of that specific container in the docker compose file https://stackoverflow.com/questions/59657728/set-cpu-limit-in-docker-compose
Author
Owner

@darrylgibbs commented on GitHub (Jun 10, 2022):

Yes it's one of my docker containers. I will need to create a new VM and try.

I didn't know that I could limit CPU usage. That's petty cool. Although, I had imagined that the usage would spin down when there is nothing to do. I didn't expect that this would be hitting the CPU continuously. Is that normal behaviour?

@darrylgibbs commented on GitHub (Jun 10, 2022): Yes it's one of my docker containers. I will need to create a new VM and try. I didn't know that I could limit CPU usage. That's petty cool. Although, I had imagined that the usage would spin down when there is nothing to do. I didn't expect that this would be hitting the CPU continuously. Is that normal behaviour?
Author
Owner

@alextran1502 commented on GitHub (Jun 10, 2022):

No that is not normal behavior. CPU should stay at around 1-2% when there is no image being uploaded to the server. I haven't seen this behavior before so it is strange, I guess it might have to do something with the specific VM you are running the containers.

Below is my production setup of Immich, when there is no operating on the server. Up time for this server is 5 days

Screen Shot 2022-06-10 at 14 12 15
@alextran1502 commented on GitHub (Jun 10, 2022): No that is not normal behavior. CPU should stay at around 1-2% when there is no image being uploaded to the server. I haven't seen this behavior before so it is strange, I guess it might have to do something with the specific VM you are running the containers. Below is my production setup of Immich, when there is no operating on the server. Up time for this server is 5 days <img width="952" alt="Screen Shot 2022-06-10 at 14 12 15" src="https://user-images.githubusercontent.com/27055614/173134421-593f7333-2daf-4318-aa48-44f479321741.png">
Author
Owner

@alextran1502 commented on GitHub (Jun 12, 2022):

Hello, did you have a chance to test on a different VM?

@alextran1502 commented on GitHub (Jun 12, 2022): Hello, did you have a chance to test on a different VM?
Author
Owner

@Leberkassemml commented on GitHub (Jun 16, 2022):

For me, when i restart my server (Openmediavault) immich_postgres does not start and an service in the stack produces a high CPU load. Once i restart immich_postgres maually, everything works fine.

Maybe that's the same problem OP has?

Note that i don't have the latest docker image yet, i use portainer and have immich-machine-learning deactivated.

@Leberkassemml commented on GitHub (Jun 16, 2022): For me, when i restart my server (Openmediavault) immich_postgres does not start and an service in the stack produces a high CPU load. Once i restart immich_postgres maually, everything works fine. Maybe that's the same problem OP has? Note that i don't have the latest docker image yet, i use portainer and have immich-machine-learning deactivated.
Author
Owner

@darrylgibbs commented on GitHub (Jun 16, 2022):

Sorry for the massive delay.

So I fired up a new VM, and install immich (using the new container layout I see) and I still have the same issue, although now it's the MACHINE LEARNING container and not MICROSERVICES. These containers have been up for about an hour at the time of the screenshot, and with about 30 images on the server. The VM has 2cores and 2GB RAM, same host HW if that makes any difference.
Screenshot 2022-06-16 093357

@darrylgibbs commented on GitHub (Jun 16, 2022): Sorry for the massive delay. So I fired up a new VM, and install immich (using the new container layout I see) and I still have the same issue, although now it's the MACHINE LEARNING container and not MICROSERVICES. These containers have been up for about an hour at the time of the screenshot, and with about 30 images on the server. The VM has 2cores and 2GB RAM, same host HW if that makes any difference. ![Screenshot 2022-06-16 093357](https://user-images.githubusercontent.com/9167471/174070911-62dc9291-dbe4-41c9-b885-1cf2c2c731f4.png)
Author
Owner

@alextran1502 commented on GitHub (Jun 16, 2022):

@darrylgibbs no problem, did you have a chance to run it on a different VM?

@alextran1502 commented on GitHub (Jun 16, 2022): @darrylgibbs no problem, did you have a chance to run it on a different VM?
Author
Owner

@darrylgibbs commented on GitHub (Jun 16, 2022):

@alextran1502 This was a different VM, but on the same Proxmox host. If I recall, you said it would have high usage during the upload period, but would it continue on for longer due to my slow hardware?

The main VM I was using, still has the software running, CPU set to 30%, but it still maxing out that 30% a week later.

@darrylgibbs commented on GitHub (Jun 16, 2022): @alextran1502 This was a different VM, but on the same Proxmox host. If I recall, you said it would have high usage during the upload period, but would it continue on for longer due to my slow hardware? The main VM I was using, still has the software running, CPU set to 30%, but it still maxing out that 30% a week later.
Author
Owner

@alextran1502 commented on GitHub (Jun 16, 2022):

Thank you, on the new VM instance, after you upload all the photos/videos, when you navigate to the Search tab on the mobile app, do you see anything on the row Things?

@alextran1502 commented on GitHub (Jun 16, 2022): Thank you, on the new VM instance, after you upload all the photos/videos, when you navigate to the `Search` tab on the mobile app, do you see anything on the row `Things`?
Author
Owner

@darrylgibbs commented on GitHub (Jun 16, 2022):

For both PLACES and THINGS it just says "No object info available."

Some of the images I uploaded are of dining room tables and chairs, so I guess if it were to object scan, those should be fairly easy to pick up.

@darrylgibbs commented on GitHub (Jun 16, 2022): For both PLACES and THINGS it just says "No object info available." Some of the images I uploaded are of dining room tables and chairs, so I guess if it were to object scan, those should be fairly easy to pick up.
Author
Owner

@alextran1502 commented on GitHub (Jun 17, 2022):

@darrylgibbs so probably somethings with that container cannot run on your machine. Is there anything strange you able to observe from the log of that container?

@alextran1502 commented on GitHub (Jun 17, 2022): @darrylgibbs so probably somethings with that container cannot run on your machine. Is there anything strange you able to observe from the log of that container?
Author
Owner

@darrylgibbs commented on GitHub (Jun 17, 2022):

Other than this, no:

today at 8:59:54 PMIllegal instruction (core dumped)
today at 9:00:00 PM
today at 9:00:00 PM> nest_microservices@0.0.1 prebuild
today at 9:00:00 PM> rimraf dist
today at 9:00:00 PM
today at 9:00:01 PM
today at 9:00:01 PM> nest_microservices@0.0.1 build
today at 9:00:01 PM> nest build
today at 9:00:01 PM

What function will I loose without that container? Object recognition?

@darrylgibbs commented on GitHub (Jun 17, 2022): Other than this, no: ``` today at 8:59:54 PMIllegal instruction (core dumped) today at 9:00:00 PM today at 9:00:00 PM> nest_microservices@0.0.1 prebuild today at 9:00:00 PM> rimraf dist today at 9:00:00 PM today at 9:00:01 PM today at 9:00:01 PM> nest_microservices@0.0.1 build today at 9:00:01 PM> nest build today at 9:00:01 PM ``` What function will I loose without that container? Object recognition?
Author
Owner

@alextran1502 commented on GitHub (Jun 17, 2022):

@darrylgibbs ohhh the container is not event starting up! It keeps restarting so that is why the CPU usage is high. You mentioned that you are using Promox right? Have you tried setting the CPU to host? Refer to the last section in Readme!

@alextran1502 commented on GitHub (Jun 17, 2022): @darrylgibbs ohhh the container is not event starting up! It keeps restarting so that is why the CPU usage is high. You mentioned that you are using Promox right? Have you tried setting the CPU to host? Refer to the last section in Readme!
Author
Owner

@darrylgibbs commented on GitHub (Jun 17, 2022):

Ah man, I forgot about that! Previously I used Immich on my Pi4, and that wasn't a concern for me then, and then I forgot about it.

It seems my CPU doesn't support AVX/AVX2 which is SUCH A BUMMER!!! Sorry for wasting your time instead of RTMF!

Either way, fantastic project you have here, and I'll use it regardless!

@darrylgibbs commented on GitHub (Jun 17, 2022): Ah man, I forgot about that! Previously I used Immich on my Pi4, and that wasn't a concern for me then, and then I forgot about it. It seems my CPU doesn't support AVX/AVX2 which is SUCH A BUMMER!!! Sorry for wasting your time instead of RTMF! Either way, fantastic project you have here, and I'll use it regardless!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#90