Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mastodon
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
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pierre Boudes
mastodon
Commits
e7723ab6
Commit
e7723ab6
authored
8 years ago
by
Eugen Rochko
Browse files
Options
Downloads
Patches
Plain Diff
Add puma preloading, decrease DB pool size to size of threads per worker
parent
53fb7b1a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
config/database.yml
+1
-1
1 addition, 1 deletion
config/database.yml
config/puma.rb
+4
-4
4 additions, 4 deletions
config/puma.rb
with
5 additions
and
5 deletions
config/database.yml
+
1
−
1
View file @
e7723ab6
default
:
&default
adapter
:
postgresql
pool
:
17
pool
:
<%= ENV["DB_POOL"] || ENV['RAILS_MAX_THREADS'] || 5 %>
timeout
:
5000
encoding
:
unicode
...
...
This diff is collapsed.
Click to expand it.
config/puma.rb
+
4
−
4
View file @
e7723ab6
...
...
@@ -30,7 +30,7 @@ workers ENV.fetch("WEB_CONCURRENCY") { 2 }
# you need to make sure to reconnect any threads in the `on_worker_boot`
# block.
#
#
preload_app!
preload_app!
# The code in the `on_worker_boot` will be called if you are using
# clustered mode by specifying a number of `workers`. After each worker
...
...
@@ -39,9 +39,9 @@ workers ENV.fetch("WEB_CONCURRENCY") { 2 }
# or connections that may have been created at application boot, Ruby
# cannot share connections between processes.
#
#
on_worker_boot do
#
ActiveRecord::Base.establish_connection if defined?(ActiveRecord)
#
end
on_worker_boot
do
ActiveRecord
::
Base
.
establish_connection
if
defined?
(
ActiveRecord
)
end
# Allow puma to be restarted by `rails restart` command.
plugin
:tmp_restart
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