【问题标题】:Rails application dying slowly on Mac Lion 10.7.2 with PhussionRails 应用程序在 Mac Lion 10.7.2 上使用 Phussion 缓慢死亡
【发布时间】: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


    【解决方案1】:

    事实证明,我的 rails 应用程序使用的是 Ruby gems Mongo 1.4.1 和 BSON 1.4.1,它们由于内存泄漏而被删除。因此,从 gems 进行简单升级就解决了这个问题。此外,使用尾随 Apache 的日志和使用乘客内存统计有助于发现问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-03-19
      • 1970-01-01
      • 2012-02-22
      • 1970-01-01
      • 1970-01-01
      • 2012-01-06
      • 1970-01-01
      相关资源
      最近更新 更多