ruby-on-rails - 设置 unicorn 超时

标签 ruby-on-rails ruby unicorn

我使用 rails 3.0.11ruby 1.9.3-p0nginx 1.0.4unicorn 3.6.2 为我的项目。我有一个问题。 我必须在我的服务器上进行长期操作。大约需要 150 秒。在这种情况下没关系。

我已经在位置设置了我的nginx配置

proxy_read_timeout 240;
proxy_send_timeout 240;

然后用命令设置我的unicorn.rb文件

timeout 240

但我总是收到 502 bad gateway 错误。 我认为, unicorn 有问题。我得到了这个 unicorn 日志

E, [2012-05-21T11:52:21.052382 #30423] ERROR -- : worker=1 PID:30871 timeout (104.052329915s > 60s), killing
E, [2012-05-21T11:52:21.080378 #30423] ERROR -- : reaped #<Process::Status: pid 30871 SIGKILL (signal 9)> worker=1
I, [2012-05-21T11:52:21.105045 #30423]  INFO -- : worker=1 spawning...
I, [2012-05-21T11:52:21.111148 #894]  INFO -- : worker=1 spawned pid=894   
I, [2012-05-21T11:52:21.111659 #894]  INFO -- : Refreshing Gem list

你能帮帮我吗?任何帮助表示赞赏。谢谢。

最佳答案

从评论中复制答案以便从“未回答”过滤器中删除此问题:

I have never used this gem, but if you're doing this after 'deploy:restart', 'unicorn:reload' you need to restart unicorn, not only reload it. sudo /etc/init.d/unicorn restart and the timeout will be set. Reload and restart are two different things in unicorn.

~ 根据 Maurício Linhares 回答

关于ruby-on-rails - 设置 unicorn 超时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10685600/

相关文章:

ruby-on-rails - 我应该使用多个数据库吗?

ruby - 排除不适用于 Rack::SSL

ruby-on-rails - Rails - 将 DateTime 与 DateTime.now 进行比较

Ruby - 乘法问题

css - Rails 2.3 应用程序未在独 Angular 兽服务器上正确发布(样式表获取 HTTP 404)

ruby-on-rails - 如果 Unicorn 启动新进程失败,Capistrano 能通知我吗

css - Coffeescript 函数在 Rails 应用程序中根本不起作用

ruby-on-rails - ElasticSearch - 格式错误的查询 (RoR)

sql - 将 SQL 查询转换为 ActiveRecord 并呈现为表

ruby-on-rails - 由于kgio_ext(LoadError),无法通过 unicorn 启动Rails应用