Created
November 25, 2018 03:15
-
-
Save bookmebus/480c6a131d62e119e1a0c63f1b7c4245 to your computer and use it in GitHub Desktop.
ElasticBeanStalk custom puma config for multiprocess x workers.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
container_commands: | |
# directory '/var/app/current' | |
# threads 8, 32 | |
# workers %x(grep -c processor /proc/cpuinfo) | |
# bind 'unix:///var/run/puma/my_app.sock' | |
# pidfile '/var/run/puma/puma.pid' | |
# stdout_redirect '/var/log/puma/puma.log', '/var/log/puma/puma.log', true | |
# daemonize false | |
01backup_config: | |
command: "cp -n /opt/elasticbeanstalk/support/conf/pumaconf.rb /opt/elasticbeanstalk/support/conf/pumaconf.rb.original" | |
02_edit_comment_default_threads_config: | |
# threads 8, 32 -> threads 4, 8 | |
command: "sed -i 's/threads 8, 32/threads 4, 8/' /opt/elasticbeanstalk/support/conf/pumaconf.rb" | |
03_delete_default_worker_config: | |
# workers %x(grep -c processor /proc/cpuinfo) -> workers 5 * %x( grep -c processor /proc/cpuinfo ).to_i | |
command: "sed -i '/workers/d' /opt/elasticbeanstalk/support/conf/pumaconf.rb" | |
04_insert_new_worker_after_threads_config: | |
command: "sed -i '/threads/a workers 5 * %x( grep -c processor /proc/cpuinfo ).to_i' /opt/elasticbeanstalk/support/conf/pumaconf.rb" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment