2016-10-01 68 views
0

我遇到與此相關的問題:Web app shuts down (502 error) while running a intensive task。 下面是代碼Web應用程序在運行密集任務時關閉-Openhift

您可以直接與尾這個應用程序: 的ssh -t [email protected] '尾巴 /日誌/*' /var/lib/gems/2.3。 0/gems/net-ssh-3.2.0/lib/net/ssh/ruby​​_compat.rb:25:在select': closed stream (IOError) from /var/lib/gems/2.3.0/gems/net-ssh-3.2.0/lib/net/ssh/ruby_compat.rb:25:in io_select' from /var/lib/gems/2.3.0/gems/net-ssh-3.2.0 /lib/net/ssh/transport/packet_stream.rb:75:in available_for_read?' from /var/lib/gems/2.3.0/gems/net-ssh-3.2.0/lib/net/ssh/transport/packet_stream.rb:87:in next_packet' from /var/lib/gems/2.3.0/gems/net-ssh-3.2.0/lib/net/ssh/transport/ session.rb:193:來自/var/lib/gems/2.3.0/gems/net-ssh-3.2.0/lib/net/ssh/transport/session.rb:188的block in poll_message' from /var/lib/gems/2.3.0/gems/net-ssh-3.2.0/lib/net/ssh/transport/session.rb:188:in循環' :在poll_message' from /var/lib/gems/2.3.0/gems/net-ssh-3.2.0/lib/net/ssh/connection/session.rb:474:in dispatch_incoming_packets' from /var/lib/gems/2.3.0/gems/net-ssh-3.2.0/lib/net/ssh/connection/session.rb:225:in preprocess' from /var/lib/gems/2.3.0/gems/net-ssh-3.2.0/lib/net/ssh/connection/session.rb:206:in process' from/var /lib/gems/2.3.0/gems/net-ssh-3.2.0/lib/net/ssh/connection/session.rb:170:in block in loop' from /var/lib/gems/2.3.0/gems/net-ssh-3.2.0/lib/net/ssh/connection/session.rb:170:in loop' from /var/lib/gems/2.3.0/ gems/net-ssh-3.2.0/lib/net/ssh/connection/session.rb:170:從012/012/16/.0/lib/net/ssh.rb:240:在start' from /var/lib/gems/2.3.0/gems/rhc-1.38.7/lib/rhc/ssh_helpers.rb:173:in ssh_ruby' from /var/lib/gems/2.3.0/gems/rhc-1.38.7/lib/rhc/commands/tail.rb:40:在tail' from /var/lib/gems/2.3.0/gems/rhc-1.38.7/lib/rhc/commands/tail.rb:21:in運行 ' 從/var/lib/gems/2.3.0/gems/rhc-1.38.7/lib/rhc/commands.rb:294:in在to_commander execute' from /var/lib/gems/2.3.0/gems/rhc-1.38.7/lib/rhc/commands.rb:285:in塊(3級)' 從/ var/lib/gems/2.3.0/gems/commander-4.2.1/lib/commander/command.rb:180:在call' from /var/lib/gems/2.3.0/gems/commander-4.2.1/lib/commander/command.rb:155:in運行' from /var/lib/gems/2.3.0/gems/commander-4.2 .1/lib/commander/runner.rb:421:在run_active_command' from /var/lib/gems/2.3.0/gems/rhc-1.38.7/lib/rhc/command_runner.rb:72:in運行!' from /var/lib/gems/2.3.0/gems/commander-4.2.1/lib/commander/delegates.rb:8:in run!' from /var/lib/gems/2.3.0/gems/rhc-1.38.7/lib/rhc/cli.rb:37:in開始' from /var/lib/gems/2.3.0/gems/ RHC-1.38.7/bin中/右心導管檢查:20:在<top (required)>' from /usr/local/bin/rhc:23:in負荷 ' 從/ usr/local/bin目錄/ RHC:23:在'' 埃德溫@埃德溫 - 聯想-FLEX-3-1130:〜$

這是什麼正確的修復。如果我在銅牌下獲得small.highcpu升級或中等cpu,如果確實與內存有關,是否仍會出現此問題?

回答

0

502是一個網關問題。其中一臺服務器的響應未到達另一臺服務器。這也發生在我身上。

我的項目是Apache和Mysql(5.5)。我發現mysql服務器是真正的問題,因爲我的流程清單非常龐大,並且由於表鎖定和其他問題導致很少的流程卡住了。

通過指定像InnoDb這樣的合適的存儲引擎並將mysql更新爲mariadb來優化我的數據庫。

通過實施像memchache這樣的緩存解決了這個問題,它減少了我的數據庫服務器上的負載並且響應速度很快。

嘗試重新啓動服務器。

如果你看到504錯誤,你也可以檢查你的兩臺服務器的超時時間。

+0

我正在使用python並運行使用芹菜的任務。我的大部分任務包括將PDF文檔轉換爲圖像進行處理。每次嘗試製作超過30MB的應用時,該應用都會關閉。實際上我預計5GB以上。我的所有存儲都是s3,現在實際上運行良好。 30MB以下的任務運行良好。 – Godfrey

+0

檢查服務器配置中的超時和腳本的最大執行速度。和最大尺寸上傳以及這不會是一個問題,但仍然。 – kanchan

相關問題