2010-12-05 50 views
0

我有一個Rails網站,在過去24小時內一直運行得非常緩慢。奇怪的是,(請參閱下面的日誌)每個請求需要45或46秒,好像正在等待某種超時。靜態內容快速加載,服務器正常運行。Slow Rails網站問題

該網站是在http://plantality.com和鐵路操場託管。它使用Apache + Passenger,Rails 2.1.1,attachment_fu,思維獅身人面像,rmagick,bbruby。

Server日誌樣本:

Processing WikiController#finder (for 66.249.67.103 at 2010-12-05 02:58:59) [GET] 
Session ID: e9e947f58fb1f0f60eeff2fc62a2de72 
Parameters: {"group"=>"1", "upright"=>"1", "houseplant"=>"1", "wi_6to12"=>"1", "bushy"=>"1", "action"=>"finder", "controller"=>"wiki", "pots_tubs"=>"1"} 
Cookie set: referer=; path=/ 
Cookie set: geo_country=; path=/ 
Rendering template within layouts/global 
Rendering wiki/finder 
Completed in 45.06793 (0 reqs/sec) | Rendering: 0.03833 (0%) | DB: 0.00878 (0%) | 200 OK [http://plantality.com/finder?bushy=1&group=1&houseplant=1&pots_tubs=1&upright=1&wi_6to12=1] 


Processing MainController#index (for 67.225.164.12 at 2010-12-05 02:59:44) [GET] 
Session ID: 0389102261c509523911c65b28c7661b 
Parameters: {"action"=>"index", "controller"=>"main"} 
Cookie set: referer=; path=/ 
Cookie set: geo_country=; path=/ 
Rendering template within layouts/global 
Rendering main/index 
Completed in 45.42652 (0 reqs/sec) | Rendering: 0.23435 (0%) | DB: 0.04589 (0%) | 200 OK [http://plantality.com/] 
+3

如果在昨天之前沒有發生這種情況,代碼沒有改變,那不是編程問題。與您的主機提供商聯繫。 – 2010-12-05 12:57:20

回答

0

解決方案:我用一個IP國家地理編碼服務。我對它進行了編碼,以便將結果緩存在cookie中,但我的網站每天從谷歌獲得約10萬次點擊。谷歌(和其他蜘蛛)沒有把cookie返回給我,所以IP服務正在限制我的使用。

所有那些說這是一個託管問題,而不是一個編程的人,噓噓。