Nextcloud version: 26.0.0
Operating system and version: Ubuntu 22.04.2 LTS
Apache version: Apache/2.4.52 (Ubuntu)
Database version: MariaDB 10.6.12
PHP version (eg, 7.4): 8.1.2
CPU: Intel(R) Core(TM) i5-6400 CPU @ 2.70GHz (4 cores)
Memory: 15.06 GB
OS and installation: 256GB SATA SSD
Data drive: 8TB WD Purple HDD
The issue you are facing:
This is not an issue as such, I am just trying to get best user experience from my new NC installation.
It is a home build, for just 2 users, but I’m a deamding user
Specs are above.
I’m curently at about half of my 8TB drive, and 99% of data are pictures and videos.
I have done the following so far:
- installed NC26 on Ubuntu, OS, NC, and all related data is on SATA SSD
- created one btrfs partition across the WD 8TB rotational HDD for the data, and configured it during NC installation
- installed preview generator app, and I’m at about half the scan at the moment
- moved appdata folder that includes preview thumbnails to SSD via mount bind which improved thumbnail display in web interface drastically
- installed and setup Recognize app which started to show faces
- installed and setup Memories app and is working fine
- installed and serup Maps app, and photos are showing correctly on it (about 14k photos with coordinates so far)
What I have NOT done yet, but plan to explore in the following days:
- opcache
- redis, APCu, or similar
- HTTP/2
What I want:
Fast user experience when browsing folders with pictures, or scrolling the Map with thumbnails shown on it. Preferably having whole database and all thumbnails in RAM.
At the moment I can load Map, and thumbnails show up in 20-30 seconds. After that they work relatively smoothly, though if I move map a lot and zoom in/out I get several “black” (unloaded) thumbnails that need few seconds to start loading. Same with browsing folders.
I know part of it is due to my preview-generation still running, my face recognition still working in the background slowly indexing faces, loading my server’s CPU and disk, and some thumbnails still missing, and so on. But I still think it can be even better.
So since I have 16GB RAM, and I’m using around 1.1-1.2GB under load, I started thinking how to load more in RAM.
My database is about 1.5GB, and I’d love it to be cached to memory completely.
My thumbnail cache is about 1GB at the moment, and I’d love it to load in server’s memory as well.
I’ve started reading about memcache techniques for local system (files), and I have some experience with databases, and I know they’ll both cache files and tables once they’re requested.
But I’d love them to be loaded when server starts. Even if my database and thumbnail folders double up by the time everything is fully indexed, that’s still “only” 5GB. If I fill my data drive completely (eventually) that would be just about 10GB of RAM taken by DB and thumbnails. So I’d still be quite good on RAM and would keep having plenty of it spare.
Nextcloud documentation is pretty good on caching, but - it still doesn’t say how to get the effect I’m expecting.
Sure, is server is up for weeks, it will eventually cache everything I regularly use. But I’d still like to use all that RAM to the fullest.
Same/similar with database. Though I could in theory make a small script, or just manually run through the database, run couple “select *” and force most of it into RAM that way, I’d rather have it using something more like MEMORY tables (though obviously permanently, not as temp tables).
I like to learn, and I’m open to suggestions. I’ll keep reading docs and tutorials, but if anyone has any hands-on experience with setting up NC in a similar way, it would save me days and days of reading.
Thanks in advance!