【发布时间】:2012-03-02 23:03:09
【问题描述】:
我对在我的简单 Rails 应用程序上使用瘦服务器非常陌生。它工作得很好,除了当我转到应用程序中的任何页面时,四分之一的或多或少的时候,我在浏览器上得到了这个:
Status: 500 Internal Server Error Content-Type: text/html
Application error
Change this error message for exceptions thrown outside of an action (like in Dispatcher setups or broken Ruby code) in public/500.html
这在日志中:
Processing PlansController#index (for 24.61.84.158 at 2012-03-02 17:53:48) [GET]
Session ID: 3105294042126eab3c6292d3ba224847
Parameters: {"controller"=>"plans", "action"=>"index"}
Rendering layoutfalseactionlist within layouts/standard
Rendering plans/list
Completed in 0.18974 (5 reqs/sec) | Rendering: 0.10813 (56%) | DB: 0.03900 (20%) | 200 OK [http://admin.blogbridge.com/]
file /tmp/ruby_sess.5684ebd33a502d9d not readable
/usr/local/rvm/rubies/ruby-1.8.7-p357/lib/ruby/1.8/pstore.rb:100:in `initialize'
/usr/local/rvm/rubies/ruby-1.8.7-p357/lib/ruby/1.8/cgi/session/pstore.rb:61:in `new'
/usr/local/rvm/rubies/ruby-1.8.7-p357/lib/ruby/1.8/cgi/session/pstore.rb:61:in `initialize'
/usr/local/rvm/rubies/ruby-1.8.7-p357/lib/ruby/1.8/cgi/session.rb:280:in `new'
/usr/local/rvm/rubies/ruby-1.8.7-p357/lib/ruby/1.8/cgi/session.rb:280:in `initialize'
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/actionpack-1.13.3/lib/action_controller/cgi_process.rb:123:in `new'
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/actionpack-1.13.3/lib/action_controller/cgi_process.rb:123:in `session'
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/actionpack-1.13.3/lib/action_controller/cgi_process.rb:155:in `stale_session_check!'
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/actionpack-1.13.3/lib/action_controller/cgi_process.rb:110:in `session'
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/actionpack-1.13.3/lib/action_controller/base.rb:1052:in `assign_shortcuts_without_flash'
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/actionpack-1.13.3/lib/action_controller/flash.rb:140:in `assign_shortcuts'
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/actionpack-1.13.3/lib/action_controller/base.rb:424:in `process_without_filters'
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/actionpack-1.13.3/lib/action_controller/filters.rb:624:in `process_without_session_management_support'
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/actionpack-1.13.3/lib/action_controller/session_management.rb:114:in `process'
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/actionpack-1.13.3/lib/action_controller/base.rb:330:in `process'
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/rails-1.2.3/lib/dispatcher.rb:41:in `dispatch'
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/thin-1.3.1/lib/rack/adapter/rails.rb:89:in `call'
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/thin-1.3.1/lib/rack/adapter/rails.rb:69:in `call'
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/thin-1.3.1/lib/thin/connection.rb:80:in `pre_process'
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/thin-1.3.1/lib/thin/connection.rb:78:in `catch'
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/thin-1.3.1/lib/thin/connection.rb:78:in `pre_process'
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/thin-1.3.1/lib/thin/connection.rb:53:in `process'
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/thin-1.3.1/lib/thin/connection.rb:38:in `receive_data'
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run_machine'
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run'
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/thin-1.3.1/lib/thin/backends/base.rb:61:in `start'
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/thin-1.3.1/lib/thin/server.rb:159:in `start'
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/thin-1.3.1/lib/thin/controllers/controller.rb:86:in `start'
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/thin-1.3.1/lib/thin/runner.rb:185:in `send'
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/thin-1.3.1/lib/thin/runner.rb:185:in `run_command'
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/thin-1.3.1/lib/thin/runner.rb:151:in `run!'
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/thin-1.3.1/bin/thin:6
/usr/local/rvm/gems/ruby-1.8.7-p357/bin/thin:19:in `load'
/usr/local/rvm/gems/ruby-1.8.7-p357/bin/thin:19
有人见过吗?
【问题讨论】:
-
更多的是一种变通方法而不是解决方案,但请考虑为会话使用 memcache 存储,它的优点是可扩展性更高、速度更快,并且很有可能避免此问题。顺便说一句,你有一个分布式架构,或者它所在的文件系统有什么特别之处吗?
-
谢谢.. 但是不,这是一个相当普通的设置。 Linode 的 Linux 机器,运行 Centos。只是尝试通过 Apache 虚拟域启动瘦服务器。还有其他想法吗?
标签: ruby ruby-on-rails-3 thin