Web应用程序在运行密集任务时关闭(502错误) [英] Web app shuts down (502 error) while running a intensive task

查看:107
本文介绍了Web应用程序在运行密集任务时关闭(502错误)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Openshifts免费版上有一个Python 3.3,mongodb,cron webapp.

I have a Python 3.3, mongodb, cron webapp on Openshifts free tier.

我知道Openshift免费版有5分钟的时间来运行cron作业或外部进程.作为一项实验,我尝试在主Web应用程序之外的线程中运行任务.

I know that the Openshift free tier has a 5 minute time limit for running cron jobs or external processes. As an experiment I tried running my task in a thread off my main web app.

我认为由于任务是线程,因此不受5分钟限制,因为这是主要的Web应用程序过程的全部内容.

I would think since the task a thread it would not be subject to the 5 minute limit because it's all apart of the main web app process.

但是,当我启动启动线程任务的应用程序时,该应用程序将在2-3分钟内关闭并给出502代理错误.必须重新启动.我是从尾巴"中拉出来的

However, when I start my app which starts the thread task the app gets shut down in 2-3 minutes and give a 502 proxy error. A restart is necessary. I pulled this from the 'tail'

有什么想法吗? Openshift是否也有CPU周期限制?我在Openshift上遇到资源限制了吗?有什么办法吗?

Any ideas what is going on? Does Openshift a CPU cycle limit also? Am I hitting some resource limit on Openshift? Any way to tell?

    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 XXXXXXXX@XXXXXXXXXXX.rhcloud.com '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>'

推荐答案

OpenShift Online具有磁盘空间,内存和cpu限制,具体取决于您使用的齿轮大小.如果您使用的是免费帐户(一小部分),则很有可能应用程序的内存不足或CPU周期不足.您可以尝试使用以下知识库文章检查是否违反了内存限制: https://www.openshift.com/kb/kb-e1082-how-to-check-for-memory-limit-violations

OpenShift Online has disk space, memory, and cpu limitations depending on what size gear you are using. It is very possible that if you are using the free account (a small gear) that your application is either running out of memory or cpu cycles. You can try checking for memory limit violations using this KB article: https://www.openshift.com/kb/kb-e1082-how-to-check-for-memory-limit-violations

这篇关于Web应用程序在运行密集任务时关闭(502错误)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆