Slow loading times / bad overall performance on a fresh local docker install

Hi,

I am experiencing overall slow performance on my gitlab installation, even though it is locally running.

Are there any performance tweaks to make? This should not be an hardware issue (6 cores, 12 threads, 16GB DDR4 RAM, running on an SATA SSD).

Slow performance means:

  • An initial page load (for example of a repository) takes multiple seconds, this can be seen in the network tab of the browser (the initial request takes most of the time, at least 2 seconds; the DOM is then ready in more than 3 seconds)
  • It could be the API response time which is slow, since curl -I http://localhost/it/testproject returns X-Runtime: 2.230676 for example
  • The slow response time disappears when the exact same repository has been viewed a few times in web UI. Then the intial request takes only 263ms. This sounds like caching.
  • Most affected are the repository pages in web ui (for example http://localhost/it/textproject).

What I did already:

  • Increased the puma workers to 5 (cpu cores - 1), from Requirements | GitLab
  • Set the puma threads to 4 (min and max), see Requirements | GitLab
  • Increased the maximum ram a puma worker can get until it gets restarted to 1250 megabytes
  • Packed PostgreSQL and Redis into an extra container, outside of Gitlab

I am using the following configuration for a self hosted gitlab installation via docker-compose.

docker-compose.yml

version: '3'

services:
  production-gitlab-redis:
    container_name: production-gitlab-redis
    image: redis:5.0.9
    command:
      - --loglevel warning
    volumes:
      - ./gitlab/redis:/var/lib/redis
    expose:
      - '6379'
      
  production-gitlab-db:
    container_name: production-gitlab-db
    image: postgres:13
    volumes:
      - ./gitlab/postgresql:/var/lib/postgresql/data
    expose:
      - '5432'
    environment:
      POSTGRES_DB: gitlabhq_production
      POSTGRES_USER: gitlab
      POSTGRES_PASSWORD: password
      
  production-gitlab-website:
    container_name: production-gitlab-website
    image: gitlab/gitlab-ce:latest
    volumes:
      - ./gitlab/config:/etc/gitlab
      - ./gitlab/logs:/var/log/gitlab
      - ./gitlab/data:/var/opt/gitlab
    ports:
      - '26:22'
      - '80:80'
      - '443:443'
    environment:
      GITLAB_OMNIBUS_CONFIG: |
        #external postgresql
        postgresql['enable'] = false
        gitlab_rails['db_adapter'] = 'postgresql'
        gitlab_rails['db_encoding'] = 'unicode'
        gitlab_rails['db_host'] = 'production-gitlab-db'
        gitlab_rails['db_password'] = 'password'
        #external redis
        redis['enable'] = false
        gitlab_rails['redis_host'] = 'production-gitlab-redis'
        gitlab_rails['redis_port'] = 6379
        #gitlab settings
        external_url 'http://localhost'
        gitlab_rails['gitlab_shell_ssh_port'] = 26
        gitlab_rails['gitlab_default_can_create_group'] = false
        gitlab_rails['gitlab_username_changing_enabled'] = false
        # Performance
        puma['worker_processes'] = 5
        puma['min_threads'] = 4
        puma['max_threads'] = 4
        puma['per_worker_max_memory_mb'] = 1250

Are there any performance tweaks, I could make? GitLab.com is much faster and snappier, so this might be a configuration issue on my side?