2012-03-26 61 views
2

我試圖通過我的Rails應用程序(通過Apache + Passenger部署)降低第一個請求服務器的響應時間。我瀏覽了Passenger文檔和this comment on stackoverflow,並修改了各種Apache配置文件(如下所示)。不幸的是,第一個請求仍然難以忍受。我究竟做錯了什麼?PassengerPreStart沒有真正啓動我的Rails3應用程序

/etc/apache2/mods-available/passenger_rvm.load

LoadModule passenger_module /home/nanda/.rvm/gems/[email protected]/gems/passenger-3.0.11/ext/apache2/mod_passenger.so 

/etc/apache2/mods-available/passenger_rvm.conf

PassengerRoot /home/nanda/.rvm/gems/[email protected]/gems/passenger-3.0.11 
PassengerRuby /home/nanda/.rvm/wrappers/[email protected]/ruby 

的/ etc/apache2的/站點可用/ beta:

<VirtualHost *:80> 
    ServerAdmin [email protected] 
    ServerName beta.myapp.com 

    DocumentRoot /home/nanda/myapp/current/public 
    <Directory /home/nanda/myapp/current/public> 
     AllowOverride All 
     Options -MultiViews 
    </Directory> 

    ErrorLog /var/log/apache2/beta.error.log 

    # Possible values include: debug, info, notice, warn, error, crit, 
    # alert, emerg. 
    LogLevel warn 

    CustomLog /var/log/apache2/beta.access.log combined 

    # from https://stackoverflow.com/a/853603/534481 
    PassengerMinInstances 5 
</VirtualHost> 

PassengerPreStart http://beta.myapp.com/ 
PassengerPoolIdleTime 0 

回答

相關問題