I
Immich•2y ago
intechm0

does machine learning need typesense to work properly?

So I've been using Immich and currently I've disabled both machine learning and typesense cause when they were enabled, it was causing microservices to not turn on and all. I'm hosting it on a fairly old cpu (Intel Pentium e5400)
18 Replies
karmacop81
karmacop81•2y ago
in my very limited understanding, immich will definwtely work wihout ML running, its just that the explore page wont work not sure about typesense i moved my ML docker to my more powerfull laptop in order to take the load off of my unraid server, so thats an option
intechm0
intechm0OP•2y ago
How did you do that?
karmacop81
karmacop81•2y ago
installed docker in WSL on my windows laptop, then spun up a immich machine learning instance, then you edit the docker-compose on your server and change the immich machine learning address to poiint to your laptop and bring it back up there is a bit more to it than that fiddle-wise but thats the main gist once id done my initial import and tagging i set it back to the server again
karmacop81
karmacop81•2y ago
Docker Compose [Recommended] | Immich
Docker Compose is the recommended method to run Immich in production. Below are the steps to deploy Immich with Docker Compose.
karmacop81
karmacop81•2y ago
you want "Hosting the machine-learning service on a different system"
sircharlo
sircharlo•2y ago
This works great, just fired this up on my laptop (which is significantly faster and more recent than my old repurposed desktop/server) and facial recognition is just blazing through the queue now.
karmacop81
karmacop81•2y ago
yeah brilliant isnt it? My NAS is great for day to day stuff but would have taken a solid week to process the ML workloads
sircharlo
sircharlo•2y ago
I wonder if there would be a way to do the same with the typesense container. This one really bogs down my server when starting up 🤔
Park Ranger
Park Ranger•2y ago
That's odd, because my Raspberry Pi 4 Model B (8GB RAM) was able to get through 11k assets within a day I keep ML and typesence enabled on my Raspberry Pi Once ML is finished processing, it's very quick
minch
minch•2y ago
Hi, I am currently having issues with typesense on the same Pi I had to delete the container, and its tsdata volume are you experiencing some difficulties as well ? for now I had to disable typesense
sogan
sogan•2y ago
If Typesense is hogging the CPU, you can set TYPESENSE_THREAD_POOL_SIZE=$(nproc) for the typesense service. The default is 8 times the cpu count, which can strain servers when they're also doing other tasks. But this won't help if it's a RAM or storage issue.
karmacop81
karmacop81•2y ago
@sogan where do we defne the TYPESENSE_THREAD_POOL_SIZE=$(nproc) setting? is it just as en environment variable in the compose file? typesense is smashing my cpu atm and the immich-server container cant connect to it 😑 im gonna roll it back to 24.0 from 24.1 like ive done before, see if that helps.. hmm, rolled typsense back but immich_server still cant connect to it, this is since updting the stack to latest version
EnochPrime
EnochPrime•2y ago
You can set the typesense host, etc. so you can host it on another machine. https://immich.app/docs/install/environment-variables#typesense
sircharlo
sircharlo•2y ago
Good stuff. I'll try that today. Facial recognition, CLIP and object tagging is going to take a few weeks still at this pace on my old server
karmacop81
karmacop81•2y ago
How do you disable typesense? ok found it in the docs
sogan
sogan•2y ago
You can add it as a new line in the typesense service:
environment:
- TYPESENSE_API_KEY=${TYPESENSE_API_KEY}
- TYPESENSE_DATA_DIR=/data
- TYPESENSE_THREAD_POOL_SIZE=$(nproc)
environment:
- TYPESENSE_API_KEY=${TYPESENSE_API_KEY}
- TYPESENSE_DATA_DIR=/data
- TYPESENSE_THREAD_POOL_SIZE=$(nproc)
Edit: Actually, I think you'd need to set an actual number here since $(nproc) won't get evaluated. You can replace $(nproc) with a number as well
minch
minch•2y ago
ok, I think I have find something. I have deleted the typesense container and the tsdata volume before creating it again (using 0.24.0 version). And then in Immich, I run the "Tag objects" and "Encode Clip" jobs again now things seem to be working properly : no high IO, tsdata volume size is contained
Inkoma 🇵🇹
I am using the command on my .env file but typesense is still running. Can you explain how you did it?

Did you find this page helpful?