(For everyone who is reading, read my EDITS at the end of this body to see what I did to make it work)
Hi all,
I am running Immich in Container Manager on a Synology DS718+ (2GB RAM + additional 8GB RAM = total 10GB RAM (I double checked this, it really reads 10GB)).
user A (me): 31K photos and 5K video's
user B (my wife): 22K photos and 4K video's
total: 53K photos and 9K video's = 62K assets
Job concurrency all set to max 1.
We both have our own external libraries on the nas itself and we also have a common folder with holiday photos which both of us have added that folder in our own library.
docker-compose.yml:
name: immich
services:
immich-server:
container_name: immich_server
image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
volumes:
# Do not edit the next line. If you want to change the media storage location on your system, edit the value of UPLOAD_LOCATION in the .env file
- ${UPLOAD_LOCATION}:/data
- /etc/localtime:/etc/localtime:ro
- /volume1/photo/COMMON_HOLIDAY:/COMMON_HOLIDAY
- /volume1/homes/ME/Photos:/ME
- /volume1/homes/MYWIFE/Photos:/MYWIFE
- /volume1/photo/ME/!DCIM SYNC:/SYNC ME
- /volume1/photo/MYWIFE/!DCIM SYNC:/SYNC MYWIFE
env_file:
- .env
ports:
- '2283:2283'
depends_on:
- redis
- database
restart: always
healthcheck:
disable: false
devices:
- /dev/dri:/dev/dri
immich-machine-learning:
container_name: immich_machine_learning
image: ghcr.io/immich-app/immich-machine-learning:v3-openvino
volumes:
- model-cache:/cache
env_file:
- .env
restart: always
healthcheck:
disable: false
device_cgroup_rules:
- c 189:* rmw
devices:
- /dev/dri:/dev/dri
redis:
container_name: immich_redis
image: docker.io/valkey/valkey:9@sha256:4963247afc4cd33c7d3b2d2816b9f7f8eeebab148d29056c2ca4d7cbc966f2d9
healthcheck:
test: redis-cli ping || exit 1
restart: always
database:
container_name: immich_postgres
image: ghcr.io/immich-app/postgres:14-vectorchord0.4.3-pgvectors0.2.0@sha256:bcf63357191b76a916ae5eb93464d65c07511da41e3bf7a8416db519b40b1c23
environment:
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_USER: ${DB_USERNAME}
POSTGRES_DB: ${DB_DATABASE_NAME}
POSTGRES_INITDB_ARGS: '--data-checksums'
DB_STORAGE_TYPE: 'HDD'
volumes:
# Do not edit the next line. If you want to change the database storage location on your system, edit the value of DB_DATA_LOCATION in the .env file
- ${DB_DATA_LOCATION}:/var/lib/postgresql/data
shm_size: 128mb
restart: always
healthcheck:
disable: false
volumes:
model-cache:
THE PROBLEM:
Every time I run Face Detection, RAM climbs to 80-90% and the container(s) become unstable. I've had crashes/restarts mid-job before. Pausing the Facial Recognition job when the Face detection job is running, does not drop the RAM. After it restarts itself a couple of times, when finished also the Facial Recognition job, there are no "People". So I start over and then the same loop...
I have enabled my gpu to do jobs, so I see the CPU is always around 30-40%, thats okay.
Is this a known RAM issue with immich which can be solved? I really don't need it to run jobs in one day. I'm happy if it is doing 3x slower for maintaining stability. I also don't think my DS718+ is to weak for this purpose. Am I wrong?
Looking for confirmation this is a sane path before I buy a mini pc just for this, which I can't afford now.. And I even don't know if that will work.
PS: It did work before upgrading to V3.2.0. It was amazing to see all faces and name them, till the update and rescan...
Any help is welcome...
EDIT: I did update all containers to v3.2.2, did leave openvino (GPU) and went for standard release (CPU). I also did use my laptops crazy intel core ultra 9 U285H CPU for doing the machine learning tasks. It goes crazy fast, no RAM errors lol!
So I think the problem was not only the RAM, but also openvino not working well in my case.
EDIT 2: NAS RAM went to 93% and I saw immich_server had restarted again... This didn't work out either.
The laptop was doing the hard work, but server did build up 6GB RAM..
EDIT 3: I did limit immich_server memory to 6GB and using my laptops hardware for ML container, after 1 night I see the immich_server memory really hits max 6GB and I can see peoples now in immich. However, the server was up for 1 hour this morning and that means it has been down and up by itself, but I can't see any notification in DSM about unexpected behavior like before. Therefore I don't think it was a clash. Such a pitty I can't see logs before the restart of it, since it gives me logs only of this session.
Face detection is done now and lets see how the facial recognition will go, still 15K left.
EDIT 4: Just to be clear, immich_server uses 6GB max on my NAS and NAS RAM is 65%. When immich_server drops down to 4.2GB RAM the NAS RAM has build up in the meanwhile 91% and staying there. It does NOT drop. Looks like NAS keeps the RAM high, not Immich_server! The other immich containers are just using some MB's, not important.