LoginSignup
0
0

More than 5 years have passed since last update.

Elastic Beanstalk上で動いているPassengerの設定を変更する

Posted at

例えばElastic Beanstalk上で稼働しているPassengerのプロセス上限数を上げたいというような場合、設定ファイルをRailsアプリのルートディレクトリ上に、passenger-standalone.jsonというファイル名で置いてデプロイすれば良い。

検証

検証するために先にeb sshし、passenger-statusで現在のMax pool sizeを確認する。

$ sudo `which passenger-status`
Version : 4.0.60
Date    : 2016-11-11 14:36:45 +0900
Instance: 6121
----------- General information -----------
Max pool size : 6
Processes     : 1
Requests in top-level queue : 0

----------- Application groups -----------
/var/app/current#default:
  App root: /var/app/current
  Requests in queue: 0
  * PID: 6191    Sessions: 0       Processed: 153251   Uptime: 8d 18h 56m 40s
    CPU: 0%      Memory  : 168M    Last used: 1s

Railsアプリのルートディレクトリにpassenger-standalone.jsonを置き、以下のように設定してeb deployする。

passenger-standalone.json
{
  "max_pool_size": 10
}

再度eb sshして現在のMax pool sizeを確認する。

$ sudo `which passenger-status`
Version : 4.0.60
Date    : 2016-11-11 14:48:32 +0900
Instance: 10058
----------- General information -----------
Max pool size : 10
Processes     : 2
Requests in top-level queue : 0

----------- Application groups -----------
/var/app/current#default:
  App root: /var/app/current
  Requests in queue: 0
  * PID: 10123   Sessions: 0       Processed: 1       Uptime: 49s
    CPU: 0%      Memory  : 76M     Last used: 49s ago
  * PID: 10132   Sessions: 0       Processed: 10      Uptime: 48s
    CPU: 0%      Memory  : 49M     Last used: 6s ago

Max pool sizeが 6 → 10となったことを確認できた。

参考

https://www.phusionpassenger.com/library/config/standalone/reference/
http://stackoverflow.com/questions/34774310/rails-elastic-beanstalk-passenger-change-passenger-configuration

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0