Yes, redis should be part of the standard install. Not doing it is just setting yourself up for disappointment.
Also I believe postgress has better performance than mariadb so no reason not to use that if you are setting it up from scratch.
Comment on Nextcloud alternatives
sdw@lemmy.ca 1 year ago
Just want to say that I’ve been there. There was a time my Nextcloud install was incredibly slow. Fortunately (or unfortunately?), it is featureful enough and widely supported that once you figure this issue out, it is a nice service to keep running.
For me, adding Redis was essential. It doesn’t really make sense to me why (nothing I do on Nextcloud is intensive or data heavy) but it has greatly improved the performance of my app.
My entire setup is a containerized Nextcloud, Nextcloud Cron, MariaDB (if I knew Postgres was an option, I would’ve chosen that), and Redis:
version: '2' services: nextcloud: container_name: nextcloud image: nextcloud:27-apache restart: unless-stopped environment: - MYSQL_PASSWORD=nextcloud - MYSQL_HOST=db - MYSQL_DATABASE=nextcloud - MYSQL_USER=nextcloud labels: - 'public-service=true' - 'traefik.enable=true' - 'traefik.http.routers.cloud.rule=Host(`nextcloud.some.domain`)' - 'traefik.http.routers.cloud.tls=true' - 'traefik.http.services.cloud.loadbalancer.server.port=80' volumes: - /some/data/dir/nextcloud/data:/var/www/html - /some/external/dir:/wew:ro nextcloud-cron: image: nextcloud:27-apache restart: unless-stopped command: [/cron.sh] environment: - MYSQL_HOST=db - MYSQL_DATABASE=nextcloud - MYSQL_USER=nextcloud - MYSQL_PASSWORD=nextcloud volumes: - /some/data/dir/nextcloud/data:/var/www/html - /some/external/dir/:/wew:ro db: image: mariadb:10.4 restart: unless-stopped environment: MYSQL_DATABASE: nextcloud MYSQL_USER: nextcloud MYSQL_ROOT_PASSWORD: nextcloud volumes: - /some/data/dir/nextcloud/db:/var/lib/mysql mysqldump: image: mariadb:10.4 depends_on: [db] # restart: never # cronjob labels: - 'cron.schedule=0 0 8 * * ?' entrypoint: [mysqldump, -h, db, -u, nextcloud, -pnextcloud, --all-databases, -r, /out/nextcloud.sql] user: root volumes: - /some/data/dir/nextcloud/db-dump:/out redis: image: redis restart: unless-stopped
Yes, redis should be part of the standard install. Not doing it is just setting yourself up for disappointment.
Also I believe postgress has better performance than mariadb so no reason not to use that if you are setting it up from scratch.
Pg has significantly better performance in a smaller self hosted environment. Notably because you’re doing a balance of reading and writing, or mostly writing since data changes regularly. For large scale operations where reading data is the primary use, MariaDB/MySQL is faster.
How is NC using redis? I can’t see any links from the NC container
I configured it in config.php directly, probably following docs.nextcloud.com/…/caching_configuration.html#i…
'memcache.local' => '\\OC\\Memcache\\APCu', 'memcache.distributed' => '\\OC\\Memcache\\Redis', 'memcache.locking' => '\\OC\\Memcache\\Redis', 'redis' => array ( 'host' => 'redis', 'port' => 6379, ),
Thanks!
Can I ask why the separate NC container for cron? Also, I presume the mysqldump container is for easy db backups?
The separate cron container made the most sense to me. Other variants “work” but imo are mostly workarounds to avoid setting up a real cronjob. Beyond this I have no real reason, nor can I vouch that is is more or less performant than others.
Yes, the mysqldump container is for easier restores. It’s much easier to restore from a .sql file than a raw data dir that was copied while the DB was running ;) (speaking from experience…)
skadden@ctrlaltelite.xyz 1 year ago
For what it’s worth you can convert the database to postgres if you want. I tried it out a few weeks ago and went flawlessly.
docs.nextcloud.com/server/…/db_conversion.html
sdw@lemmy.ca 1 year ago
I’ll try this next time I need to restore the DB from backup, cheers!