Speed of nextcloud on GlusterFS in Docker Swarm

I have a question regarding speed of Nextcloud on GlusterFS in Docker Swarm. Let me first describe our setup:

GlusterFS storage node pool 
Docker Swarm node Pool
Nextcloud docker container instance behind an nginx docker instance
  Nextcloud instance settings:
    - image: nextcloud:20-fpm-alpine
    - glusterfs-volume:/var/www/html

The thing about this setup is that even when GlusterFS is optimized for small files the TTFB is about 600ms to 1s. Without any GlusterFS optimization the TTFB metric is about 2.3s. (Measured on dashboard with multiple web page reloads and clean install with no additional apps)

When GlusterFS is removed from the equation - using storage on docker swarm nodes itself - nextcloud is lightning fast (max. 200ms TTFB).

My question is:
From what I’ve read I can separate the app folder from the rest of the application, so: Am I able to create a container image with preinstalled nextcloud - all basic nextcloud app code inside of it - and just specify an external nextcloud apps volume? Are there any limitations?

If it would be feasible, then I would use the official docker nextcloud image as a base imag, run the installer that runs at boot time and modify configs to create a custom image, that in future could be easily maintainable with this approach.

Thank you for your answers!

for my understanding of the “install process” the folders in this file

are “volatile” and/or their content can be altert by users.

that is to say: this folder should be on your GlusterFS.

before you create your own image you could try if that would help you. or?

Thank you for the hint, I will give it a shot and try to come up with a solution and post it here, if I’m successful :slight_smile:

just in case. that’s the line where nextcloud is “installed” during startup of the container. it copies the version of the image into the fs of the container.

you would need to move this into the Dockerfile of your “homemade” image. i think.

1 Like