【发布时间】:2012-02-23 14:40:57
【问题描述】:
我最近在 Mac mini 上部署了我的第一个 Rails 应用程序,该 Mac mini 运行带有 Apache 和 Phusion Passenger 的 Lion 10.7.2。这是一台四核机器,上面有 2 个 ram。服务器起初似乎很好,只处理少数请求。但是,在请求开始增加后,它会锁定。这是我第一次部署 ROR 的服务器,我不确定我应该检查什么。我查看了正在运行的 ruby 进程,它大约有 5 或 6 个。
该应用程序非常依赖数据库和 AJAX。
我已阅读有关优化 Phusion Passenger 的其他帖子,但似乎没有帮助。我的 httpd.conf 文件如下所示:
<VirtualHost *:80>
ServerName http://domain.com/
DocumentRoot /Users/lab/WebApplications/next_browse_app/public
PassengerSpawnMethod conservative
# Speeds up spawn time tremendously -- if your app is compatible.
# RMagick seems to be incompatible with smart spawning
RailsSpawnMethod smart
# Keep the application instances alive longer. Default is 300 (seconds)
PassengerPoolIdleTime 1000
# Keep the spawners alive, which speeds up spawning a new Application
# listener after a period of inactivity at the expense of memory.
RailsAppSpawnerIdleTime 0
# Just in case you're leaking memory, restart a listener
# after processing 5000 requests
PassengerMaxRequests 5000
PassengerMaxPoolSize 4
PassengerMaxInstancesPerApp 4
<Directory /Users/lab/WebApplications/next_browse_app/public>
AllowOverride all
Allow from all
Options -MultiViews
</Directory>
非常感谢任何帮助!谢谢!
【问题讨论】:
标签: ruby-on-rails apache passenger