运行密集型任务时Web应用程序关闭-Openshift

时间:2016-10-01 21:01:36

标签: openshift

我遇到了与此相关的问题:Web app shuts down (502 error) while running a intensive task。 这是代码

您可以直接使用以下方式拖动此应用程序: ssh -t 577d56787628e1406200010c@mainserver-bizcentral.rhcloud.com'尾巴 /日志 / *” /var/lib/gems/2.3.0/gems/net-ssh-3.2.0/lib/net/ssh/ruby_compat.rb:25:in 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'     来自/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'     来自/var/lib/gems/2.3.0/gems/net-ssh-3.2.0/lib/net/ssh/transport/session.rb:193:in 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 loop'     来自/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'     来自/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进程'     来自/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'     来自/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/rhc-1.38.7/lib/rhc/ssh_helpers.rb:198:in阻止ssh_ruby'     来自/var/lib/gems/2.3.0/gems/net-ssh-3.2.0/lib/net/ssh.rb:240:in 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:in tail' from /var/lib/gems/2.3.0/gems/rhc-1.38.7/lib/rhc/commands/tail.rb:21:in run'     来自/var/lib/gems/2.3.0/gems/rhc-1.38.7/lib/rhc/commands.rb:294:in execute' from /var/lib/gems/2.3.0/gems/rhc-1.38.7/lib/rhc/commands.rb:285:in阻止(3级)to_commander'     来自/var/lib/gems/2.3.0/gems/commander-4.2.1/lib/commander/command.rb:180:in call' from /var/lib/gems/2.3.0/gems/commander-4.2.1/lib/commander/command.rb:155:in运行'     来自/var/lib/gems/2.3.0/gems/commander-4.2.1/lib/commander/runner.rb:421:in run_active_command' from /var/lib/gems/2.3.0/gems/rhc-1.38.7/lib/rhc/command_runner.rb:72:in运行!'     来自/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 start'     from /var/lib/gems/2.3.0/gems/rhc-1.38.7/bin/rhc:20:in <top (required)>' from /usr/local/bin/rhc:23:in load'     来自/ usr / local / bin / rhc:23:in'' edwin @ edwin-Lenovo-FLEX-3-1130:〜$

对此有什么正确的解决方法。如果我获得了一个small.highcpu升级版或者是青铜版的中等CPU,如果它确实与内存有关,那么这个问题是否还会出现?

1 个答案:

答案 0 :(得分:0)

502是一个网关问题。您的某个服务器的响应未到达另一台服务器。这也发生在我身上。

我的项目是在Apache和Mysql(5.5)上。我发现mysql服务器是真正的问题,因为我的流程列表非常庞大,并且由于表锁定和其他问题,很少有进程被卡住了。

通过指定适当的存储引擎(如InnoDb和更新的mysql到mariadb)来优化我的数据库。

通过实现像memchache这样的缓存解决了这个问题,减少了数据库服务器上的负载并且响应很快。

尝试重新启动服务器。

如果您看到504错误,也可以检查两台服务器的超时。