LoginSignup
6
6

More than 5 years have passed since last update.

Passengerでプロセスを個別にkillする

Last updated at Posted at 2013-07-18
$ kill -SIGUSR1 PID

実験環境

  • Amazon Linux 2013.03
  • httpd-2.2.25-1.0
  • rvm 1.21.6
  • ruby 1.9.3p448
  • rails 3.2.13
  • passenger 4.0.2

実験

  • 以下のような処理をするcontrollerを持つ適当なrailsアプリを準備
def test
  sleep 30
  render :text => "hogehoge"
end
  • Apacheとpassengerを設定(passengerの設定としては以下のようにした)
PassengerMaxPoolSize 2
PassengerMinInstances 2
  • Webで作成したcontrollerへのパスにアクセスする
  • 処理している間にpassenger-statusコマンドでPIDを確認し以下のようにkill(2プロセスとも)
$ kill -SIGUSR1 PID
  • 結果
    • => Webでhogehogeが返ることを確認
    • => passenger-statusでプロセスが2つとも入れ替わることを確認
    • => kill -SIGTERMすると途中でInternal Server Error発生
6
6
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
6
6