Commit 8c605bedcc8deecac4ae2bae7c99f6e6211732f3

Authored by Jacob Vosmaer
1 parent 8bd9b1d5
Exists in master

Document workaround for Postgres memory errors

Showing 1 changed file with 23 additions and 0 deletions   Show diff stats
README.md
... ... @@ -104,6 +104,29 @@ get their security context messed up. You can fix this by running `sudo
104 104 gitlab-ctl reconfigure`, which will run a `chcon --recursive` command on
105 105 `/var/opt/gitlab/.ssh`.
106 106  
  107 +#### Postgres error 'FATAL: could not create shared memory segment: Cannot allocate memory'
  108 +
  109 +The bundled Postgres instance will try to allocate 25% of total memory as
  110 +shared memory. On some Linux (virtual) servers, there is less shared memory
  111 +available, which will prevent Postgres from starting. In
  112 +`/var/log/gitlab/postgresql/current`:
  113 +
  114 +```
  115 + 1885 2014-08-08_16:28:43.71000 FATAL: could not create shared memory segment: Cannot allocate memory
  116 + 1886 2014-08-08_16:28:43.71002 DETAIL: Failed system call was shmget(key=5432001, size=1126563840, 03600).
  117 + 1887 2014-08-08_16:28:43.71003 HINT: This error usually means that PostgreSQL's request for a shared memory segment exceeded available memory or swap space, or exceeded your kernel's SHMALL parameter. You can either reduce the request size or reconfigure the kernel with larger SHMALL. To reduce the request size (currently 1126563840 bytes), reduce PostgreSQL's shared memory usage, perhaps by reducing shared_buffers or max_connections.
  118 + 1888 2014-08-08_16:28:43.71004 The PostgreSQL documentation contains more information about shared memory configuration.
  119 +```
  120 +
  121 +You can manually lower the amount of shared memory Postgres tries to allocate
  122 +in `/etc/gitlab/gitlab.rb`:
  123 +
  124 +```ruby
  125 +postgresql['shared_buffers'] = "100MB"
  126 +```
  127 +
  128 +Run `sudo gitlab-ctl reconfigure` for the change to take effect.
  129 +
107 130 #### Reconfigure fails to create the git user
108 131  
109 132 This can happen if you run `sudo gitlab-ctl reconfigure` as the git user.
... ...