avatar of hatsune miku

The Nextcloud Performance Puzzle

2024-09-02

Back when I first set up my server, I used Nextcloud as an all-in-one solution for file sharing, CalDAV/CardDAV, notes, and more. The performance was glacial - every page load took an eternity, and the UI would occasionally freeze, leaving me wondering if I'd accidentally turned my server into a doorstop. I eventually threw in the towel and opted for a more modular approach, breaking out individual services like Radicale, Filebrowser, and Memos.

Fast forward to a friend of mine embarking on their own self-hosting adventure, with Nextcloud firmly in their sights. Despite my warnings, they were determined to make it work. They tweaked PHP configs, experimented with Redis, and even considered swapping out the database. I was convinced that SQLite would be more than sufficient, so I didn't bother offering my expertise to help them set up MariaDB. But, after a few days of tinkering, they managed to get MariaDB up and running - and, to my surprise, their performance issues vanished into thin air.

I was baffled. SQLite should be able to handle a tiny Nextcloud instance with ease, so what was going on? My best guess is that SQLite's tendency to sync queries with the disk was causing high latencies on their HDD, while MariaDB was able to handle queries in memory and flush changes to disk in the background.

Now, I'm tempted to set up Nextcloud again, just for kicks. But, I'm pretty happy with my current setup, and I don't miss the thrill of Nextcloud self-destructing after every update. Maybe I'll just stick to living vicariously through my friend's success story.