タグ

unicornに関するhibomaのブックマーク (5)

  • The Philosophy Behind unicorn

    Application_Timeouts CONTRIBUTORS DESIGN FAQ HACKING ISSUES KNOWN_ISSUES LICENSE Links NEWS PHILOSOPHY README SIGNALS Sandbox TUNING unicorn_1 Unicorn Configurator HttpServer OobGC PrereadInput StreamInput TeeInput Util Worker The Philosophy Behind unicorn Being a server that only runs on Unix-like platforms, unicorn is strongly tied to the Unix philosophy of doing one thing and (hopefully) doing

  • Unicornを同期的に再起動する - 昼メシ物語

    Unicornの再起動はシグナル(USR2等)を発行することで非同期的に行われるので、成功したのか失敗したのかがわかりづらい。 例えばCapistrano等でアプリケーションをデプロイしたあと、Unicornの再起動を行い、その再起動が成功か失敗かを判断したいことがある。 というわけで、 Unicorn を 同期的に restart するスクリプトを書いた。 使い方と仕組み 上記スクリプトを unicorn_restart.rb みたいな名前で保存し、以下のように Unicorn の PID ファイルを与えて実行します。 $ unicorn_restart.rb /tmp/unicorn.pidこれは以下のように動作します。 unicorn の master プロセスに USR2 シグナルを送る unicorn.pid.oldbin を監視し、再起動が終わるのを待つ 再起動が終わったら、

    Unicornを同期的に再起動する - 昼メシ物語
  • Nginx + Unicorn for Rails on Rackhub

    You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert

    Nginx + Unicorn for Rails on Rackhub
  • たいぷらいたーざっき。(2011-08-22)

    _ [Rails][Linux] unicorn_railsのworkerを動的に増減させる unicorn_railsのworkerプロセスを動的に増減させる方法があるようです。 Getting Started with Unicorn : codelevy workerを増やす kill -s TTIN <masterプロセスのPID> workerを減らす kill -s TTOU <masterプロセスのPID> 実践 # ps axf PID TTY STAT TIME COMMAND 576 ? S 0:00 unicorn_rails master -c config/unicorn.rb -E production -D --path /wiki 577 ? S 0:02 \_ unicorn_rails worker[0] -c config/unicorn.rb -E

    hiboma
    hiboma 2012/02/21
    kill -s TTIN, kill -s TTOU
  • unicornのタイムアウト時にもRailsのログをちゃんと出力させる - 昼メシ物語

    unicornはconfで timeout 20 とかやっとくと、20秒以上かかったらそのworkerが殺される。それはいい。問題はその殺され方にあって、タイムアウトしたunicorn workerはmasterにKILLシグナルで強制的に殺される。KILLで殺されてしまうと、worker側でtrapして安全に終了処理をすることができない。 一番困るのは、Railsloggerは(production環境のデフォルトだと)リクエストが終了するまでバッファリングしているので、リクエストの途中でKILLされてしまうとloggerがflushされない。つまり、unicornのタイムアウト時には、リクエストのログは一切production.logには出力されない。異常時のログが出ないとか、まじで困ると思うんだけど、みんなどうしてんだろ。 これに対処するためにはunicornのコードに手を入れるの

    unicornのタイムアウト時にもRailsのログをちゃんと出力させる - 昼メシ物語
  • 1