sameersbn / sameersbn/docker-gitlab

Slow loading times / bad performance on a fresh local install

Open
#2,288 5 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Shell
Stars
8.1k
Forks
2.1k
Avg merge
17h 47m
Merged PRs (30d)
7

Description

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, since I use a Ryzen 5 1600X (6 cores, 12 threads) with 16 GB DDR4 3200MHz RAM and a SATA SSD.

Slow performance means:

  • An initial page load in web ui (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 full seconds; the DOM is then finally ready in more than 3 full 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).
  • Also after a container restart the performance at start is verly slow.

gitlab_slow

What I did already:

My docker-compose.yml looks like the example (https://github.com/sameersbn/docker-gitlab/blob/master/docker-compose.yml) except the environment variables described above.

Content of my docker-compose.yml
version: '2.3'

services:
  production-gitlab-redis:
    container_name: production-gitlab-redis
    image: redis:5.0.9
    command:
      - --loglevel warning
    volumes:
      - ./redis:/var/lib/redis:Z

  production-gitlab-postgresql:
    container_name: production-gitlab-postgresql
    image: sameersbn/postgresql:12-20200524
    volumes:
      - ./postgresql:/var/lib/postgresql:Z
    environment:
      - DB_USER=gitlab
      - DB_PASS=password
      - DB_NAME=gitlab
      - DB_EXTENSION=pg_trgm,btree_gist

  production-gitlab-gitlab:
    container_name: production-gitlab-website
    image: sameersbn/gitlab:13.7.1
    depends_on:
      - production-gitlab-redis
      - production-gitlab-postgresql
    ports:
      - "80:80"
      - "26:22"
    volumes:
      - ./gitlab:/home/git/data:Z
    healthcheck:
      test: ["CMD", "/usr/local/sbin/healthcheck"]
      interval: 5m
      timeout: 10s
      retries: 3
      start_period: 5m
    environment:
    - DEBUG=false

    - DB_ADAPTER=postgresql
    - DB_HOST=production-gitlab-postgresql
    - DB_PORT=5432
    - DB_USER=gitlab
    - DB_PASS=password
    - DB_NAME=gitlab

    - REDIS_HOST=production-gitlab-redis
    - REDIS_PORT=6379

    - TZ=Europe/Berlin
    - GITLAB_TIMEZONE=Berlin

    - GITLAB_HTTPS=false
    - SSL_SELF_SIGNED=false

    - GITLAB_HOST=localhost
    - GITLAB_PORT=80
    - GITLAB_SSH_PORT=26
    - GITLAB_RELATIVE_URL_ROOT=
    
    - PUMA_WORKERS=5
    - PUMA_THREADS_MIN=4
    - PUMA_THREADS_MAX=4
    - PUMA_PER_WORKER_MAX_MEMORY_MB=1250
    
    - GITLAB_SECRETS_DB_KEY_BASE=secret
    - GITLAB_SECRETS_SECRET_KEY_BASE=secret
    - GITLAB_SECRETS_OTP_KEY_BASE=secret

    - GITLAB_NOTIFY_ON_BROKEN_BUILDS=false
    - GITLAB_NOTIFY_PUSHER=false

Are there any performance tweaks I could do? I would like to get the response time to < 1 second, like gitlab.com did.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the provided docker-compose.yml, the repository page endpoint, and the curl timing and browser network results. Compare cold and warmed requests after container startup, then inspect the configured PostgreSQL, Redis, and Puma settings to identify the bottleneck. Done means a reproducible cause and a documented configuration or fix that substantially improves the initial response time.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, docker-compose, postgresql, redis
Domain
databases, devops, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.