2014-05-15 34 views
1

我在Openshifts免費層上有一個Python 3.3,mongodb,cron webapp。運行密集任務時,Web應用程序關閉(502錯誤)

我知道Openshift免費套餐對於運行cron作業或外部進程有5分鐘的時間限制。作爲一個實驗,我嘗試在我的主要網絡應用程序的線程中運行我的任務。

我會認爲,自任務線程以來,它不會受到5分鐘的限制,因爲它是主要Web應用程序進程的一部分。

但是,當我啓動我的應用程序啓動線程任務時,應用程序在2-3分鐘內關閉併發出502代理錯誤。重新啓動是必要的。我把它從'尾巴'上拉下來

任何想法是怎麼回事?是否也打開CPU週期限制?我在Openshift上遇到一些資源限制嗎?有什麼方法可以告訴?

Thu May 15 13:15:53.047 [signalProcessingThread] got signal 15 (Terminated), will terminate after current cmd ends 
    Thu May 15 13:15:53.048 [signalProcessingThread] now exiting 
    Thu May 15 13:15:53.058 dbexit: 
    Thu May 15 13:15:53.058 [signalProcessingThread] shutdown: going to close listening sockets... 
    Thu May 15 13:15:53.058 [signalProcessingThread] closing listening socket: 11 
    Thu May 15 13:15:53.058 [signalProcessingThread] shutdown: going to flush diaglog... 
    Thu May 15 13:15:53.058 [signalProcessingThread] shutdown: going to close sockets... 
    Thu May 15 13:15:53.111 [signalProcessingThread] shutdown: waiting for fs preallocator... 
    Thu May 15 13:15:53.111 [signalProcessingThread] shutdown: lock for final commit... 
    Thu May 15 13:15:53.111 [signalProcessingThread] shutdown: final commit... 
    Thu May 15 13:15:53.112 [signalProcessingThread] shutdown: closing all files... 
    Thu May 15 13:15:53.112 [signalProcessingThread] closeAllFiles() finished 
    Thu May 15 13:15:53.112 [signalProcessingThread] journalCleanup... 
    Thu May 15 13:15:53.112 [signalProcessingThread] removeJournalFiles 
    Thu May 15 13:15:53.145 [signalProcessingThread] shutdown: removing fs lock... 
    Thu May 15 13:15:53.166 dbexit: really exiting now 


    You can tail this application directly with: 
    ssh -t [email protected] 'tail */logs/*' 

    C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/net-ssh-2.6.7/lib/net/ssh/ruby_compat.rb:30:in `select': closed stream (IOError) 
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/net-ssh-2.6.7/lib/net/ssh/ruby_compat.rb:30:in `io_select' 
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/net-ssh-2.6.7/lib/net/ssh/transport/packet_stream.rb:73:in `available_for_read?' 
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/net-ssh-2.6.7/lib/net/ssh/transport/packet_stream.rb:85:in `next_packet' 
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/net-ssh-2.6.7/lib/net/ssh/transport/session.rb:172:in `block in poll_message' 
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/net-ssh-2.6.7/lib/net/ssh/transport/session.rb:167:in `loop' 
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/net-ssh-2.6.7/lib/net/ssh/transport/session.rb:167:in `poll_message' 
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/net-ssh-2.6.7/lib/net/ssh/connection/session.rb:454:in `dispatch_incoming_packets' 
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/net-ssh-2.6.7/lib/net/ssh/connection/session.rb:216:in `preprocess' 
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/net-ssh-2.6.7/lib/net/ssh/connection/session.rb:200:in `process' 
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/net-ssh-2.6.7/lib/net/ssh/connection/session.rb:164:in `block in loop' 
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/net-ssh-2.6.7/lib/net/ssh/connection/session.rb:164:in `loop' 
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/net-ssh-2.6.7/lib/net/ssh/connection/session.rb:164:in `loop' 
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rhc-1.7.8/lib/rhc/ssh_helpers.rb:51:in `block in ssh_ruby' 
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/net-ssh-2.6.7/lib/net/ssh.rb:199:in `start' 
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rhc-1.7.8/lib/rhc/ssh_helpers.rb:39:in `ssh_ruby' 
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rhc-1.7.8/lib/rhc/commands/tail.rb:39:in `tail' 
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rhc-1.7.8/lib/rhc/commands/tail.rb:20:in `run' 
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rhc-1.7.8/lib/rhc/commands.rb:240:in `execute' 
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rhc-1.7.8/lib/rhc/commands.rb:231:in `block (3 levels) in to_commander' 
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/commander-4.1.3/lib/commander/command.rb:180:in `call' 
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/commander-4.1.3/lib/commander/command.rb:180:in `call' 
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/commander-4.1.3/lib/commander/command.rb:155:in `run' 
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/commander-4.1.3/lib/commander/runner.rb:402:in `run_active_command' 
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rhc-1.7.8/lib/rhc/command_runner.rb:70:in `run!' 
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/commander-4.1.3/lib/commander/delegates.rb:7:in `run!' 
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rhc-1.7.8/lib/rhc/cli.rb:36:in `start' 
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rhc-1.7.8/bin/rhc:18:in `<top (required)>' 
    from C:/Ruby200-x64/bin/rhc:23:in `load' 
    from C:/Ruby200-x64/bin/rhc:23:in `<main>' 

回答

0

OpenShift Online具有磁盤空間,內存和cpu限制,具體取決於您使用的齒輪大小。如果您使用的是免費帳戶(小型設備),您的應用程序可能會耗盡內存或cpu週期,這很可能是這樣。您可以嘗試使用此知識庫文章檢查內存限制違規:https://www.openshift.com/kb/kb-e1082-how-to-check-for-memory-limit-violations

+0

我在哪裏可以找到有關CPU週期限制的更多信息?我有一種感覺就是這個問題。 –

+0

@fat fantasma。你是如何解決這個問題的? – Godfrey

+0

你只需要確保你的cron作業不超過5分鐘。你可能不得不把它分成大塊。或支付升級的層級。 –

相關問題