immich icon indicating copy to clipboard operation
immich copied to clipboard

CLI Upload is getting slower and slower, depends on Album size

Open commanderalpha opened this issue 1 year ago • 8 comments

The bug

Hello, I'm uploading my camera Folder to Immich with the CLI Tool. This works fine after the bug with the too many files are fixed. But now I see some other issue. I use the album function to create albums out of the folder names. But I have one folder with around 30k of potos und movies (around 200GB). I see that the speed in files/sec is getting slower and slower. I aborted the uplaod at around 50%. At this time the speed was slow one pictures every three seconds. So I moved all the uploaded file from the folder, so that the queue is not that big. But this doesnt helped.

But I figured out that depends on the items in the album in Immich. When i start the Upload to a new album like "camera2" the speed is back at normal condition. Of course getting slower. Maybe i will use a third album.

Best regards

The OS that Immich Server is running on

Docker in Unraid

Version of Immich Server

1.93.3

Version of Immich Mobile App

doesnt matter

Platform with the issue

  • [X] Server
  • [ ] Web
  • [ ] Mobile

Your docker-compose.yml content

I dont know how to get the right information. 

I'm running three Containers for Immich (Redis, Postgree, Immich)

Your .env content

I dont know how to get the right information.

Reproduction steps

see above

Additional information

Jobs on the server are paused during upload to get max upload performance

commanderalpha avatar Jan 26 '24 11:01 commanderalpha

As you are doing bulk upload, your server CPU and disk IO usage will be maxed out, so this is expected

alextran1502 avatar Jan 26 '24 12:01 alextran1502

Hi Alex,

no i don't think its a performance issue, because:

  1. I paused the server Jobs at the immich server
  2. When I observe the CPU Load and Disk IO it doesn't look that the server is under heavy load.
  3. If you already have an album with 20k items, the upload is slow from the first picture.
  4. If you upload the same files again in the same album, they didn't transver due to duplicate check, but speed is super slow.
  5. Even if you dont stop the Jobs on the server and the load is high, the upload is fast at the begining.
  6. The speed decreases linear form item to item. As i wrote, after some hours you reach just one picture every 3-4 seconds, immich server is faster at this point and got all the jobs from the first picutre done.

Maybe someone else can check this? Thanks.

But yes of course, such kind of upload you just one or two times.

BR

commanderalpha avatar Jan 27 '24 09:01 commanderalpha

Hello, I used to get immich working with the official method, and used to get cli working as well, now I am using the 3 containers like you but I can't seem to find a way to make cli work, how did you get yours to work?

capsyweb avatar Feb 21 '24 00:02 capsyweb

I am noticing the same thing for Movies. they upload very slowly. A 470M file took many minutes to a point where I thought something had gone wrong. The server has almost no load at all.

pelaxa avatar Mar 02 '24 15:03 pelaxa

Uploading a 3,5 GB Video, take very long only uploading with 3,3 MB over WLAN. Server not under load

Doomstein007 avatar Mar 27 '24 07:03 Doomstein007

This issue is specific to the slowdown described when setting an album in the CLI as the album grows in size.

@commanderalpha Can you share if you still see this behavior on the latest version of the CLI? It's been heavily refactored recently.

mertalev avatar Apr 01 '24 06:04 mertalev

Hi, I tried it. Uploading a Folder with 37k images into an album with around 33k images. So uploading around 4k images. crawling assets take some time, but that seems ok. Uploading is working as expected. So for me, it seems to be fixed. THX.

BR

commanderalpha avatar Apr 21 '24 12:04 commanderalpha

I'm seeing this issue on the web interface, uploading is fast but then the item is stuck in adding to album for several seconds blocking the queue. The bigger the album the slower it gets. The server is running on a pretty old PC, the issue is already pretty bad even before getting to 1k images on the same album.

nsubiron avatar Jul 25 '24 08:07 nsubiron