Skip to content
This repository has been archived by the owner on Sep 25, 2019. It is now read-only.

Check-in puma.rb #311

Open
wants to merge 4 commits into
base: development
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions config/puma.rb.sample → config/puma.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
pidfile 'tmp/pids/puma.pid'
state_path 'tmp/pids/puma.state'

# stdout_redirect 'log/puma.log', 'log/puma_err.log'
stdout_redirect 'log/puma.log', 'log/puma_err.log'

# quiet
threads 0, 30
bind 'unix://tmp/sockets/puma.sock'
threads 10, 20
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to set so high. this might cause too many requests to be timesliced on one thread.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about min = 0, max = 10?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How can I know what's the "right" number? 😕

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe for mine I used min=1, max=4... but you might wanna tweak this when you have instrumentation.

bind 'unix:///var/www/coursemology/tmp/sockets/puma.sock'

# ssl_bind '127.0.0.1', '9292', { key: path_to_key, cert: path_to_cert }

Expand All @@ -31,12 +31,13 @@

# === Cluster mode ===

# workers 2

workers 2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and should set this to # of cpus on the virtual server. not sure if ours has 2.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, we have 2. grep processor /proc/cpuinfo | wc -l says 2.

# on_worker_boot do
# puts 'On worker boot...'
# end

# === Puma control rack application ===

activate_control_app 'unix://tmp/sockets/pumactl.sock'

preload_app!