Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Greenlight
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Arbeitsgruppe Hardwarenahe IT-Systeme
Greenlight
Commits
44abc0e9
Unverified
Commit
44abc0e9
authored
4 years ago
by
Jesus Federico
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
GRN2-XX: Patch to overcome performance issues with the database. (#2454)
parent
60b8bbfa
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
config/database.yml
+3
-1
3 additions, 1 deletion
config/database.yml
sample.env
+12
-5
12 additions, 5 deletions
sample.env
with
15 additions
and
6 deletions
config/database.yml
+
3
−
1
View file @
44abc0e9
default
:
&default
default
:
&default
pool
:
9
pool
:
5
timeout
:
5000
timeout
:
5000
development
:
development
:
...
@@ -22,3 +22,5 @@ production:
...
@@ -22,3 +22,5 @@ production:
username
:
<%= ENV['DB_USERNAME'] %>
username
:
<%= ENV['DB_USERNAME'] %>
password
:
<%= ENV['DB_PASSWORD'] %>
password
:
<%= ENV['DB_PASSWORD'] %>
pool
:
<%= ENV['DB_POOL_SIZE'] || '9' %>
pool
:
<%= ENV['DB_POOL_SIZE'] || '9' %>
connect_timeout
:
<%= ENV['DB_CONNECT_TIMEOUT'] || '5' %>
read_timeout
:
<%= ENV['DB_READ_TIMEOUT'] || '120' %>
This diff is collapsed.
Click to expand it.
sample.env
+
12
−
5
View file @
44abc0e9
...
@@ -259,7 +259,7 @@ ENABLE_SSL=true
...
@@ -259,7 +259,7 @@ ENABLE_SSL=true
# Database settings
# Database settings
#
#
# Greenlight may work out of the box with sqlite3, but for production it is recommended to use postgresql.
# Greenlight may work out of the box with sqlite3, but for production it is recommended to use postgresql.
# In such case, these variables must be included
.
# In such case, these variables must be included
:
#
#
# DB_ADAPTER=postgresql
# DB_ADAPTER=postgresql
# DB_HOST=postgres.example.com
# DB_HOST=postgres.example.com
...
@@ -267,11 +267,19 @@ ENABLE_SSL=true
...
@@ -267,11 +267,19 @@ ENABLE_SSL=true
# DB_NAME=greenlight_production
# DB_NAME=greenlight_production
# DB_USERNAME=postgres
# DB_USERNAME=postgres
# DB_PASSWORD=password
# DB_PASSWORD=password
#
# The ActionCable-Workers require 4 connections. So, when using postgres as the CABLE_ADAPTER
# make sure the Database can handle the overall connection count calculated as follows:
# ( RAILS_MAX_THREADS + 4 ) * WEB_CONCURRENCY
# So DB_POOL_SIZE should be set to RAILS_MAX_THREADS + 4
#
# DB_POOL_SIZE=9
# DB_POOL_SIZE=9
#
#
# DB_POOL_SIZE should be set to RAILS_MAX_THREADS + 4
# Additionally, there may be cases where the database has errors so the old db connections became stale.
# The ActionCable-Workers require 4 connections.
# In order to overcome the lost of connections, it is recommended to add a timeout.
# Make sure your Database can handle the overall connection count calculated as follows: ( RAILS_MAX_THREADS + 4 ) * WEB_CONCURRENCY
#
# DB_CONNECT_TIMEOUT=5
# DB_READ_TIMEOUT=120
#
#
# For deployments based on the docker-compose script also included, the HOST should be set with the Docker container id.
# For deployments based on the docker-compose script also included, the HOST should be set with the Docker container id.
#
#
...
@@ -281,7 +289,6 @@ DB_PORT=5432
...
@@ -281,7 +289,6 @@ DB_PORT=5432
DB_NAME=greenlight_production
DB_NAME=greenlight_production
DB_USERNAME=postgres
DB_USERNAME=postgres
DB_PASSWORD=password
DB_PASSWORD=password
DB_POOL_SIZE=9
# Use postgresql to handle ActionCable connections by default
# Use postgresql to handle ActionCable connections by default
CABLE_ADAPTER=postgresql
CABLE_ADAPTER=postgresql
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment