0
votes

I have an issue related to this: Web app shuts down (502 error) while running a intensive task. Here is the code

You can tail this application directly with: ssh -t 577d56787628e1406200010c@mainserver-bizcentral.rhcloud.com 'tail /log/*' /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:inio_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:innext_packet' from /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:inloop' 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:indispatch_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:inprocess' 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:inloop' 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/rhc-1.38.7/lib/rhc/ssh_helpers.rb:198:inblock in ssh_ruby' from /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:inssh_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:inrun' from /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:inblock (3 levels) in to_commander' from /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:inrun' from /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:inrun!' 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:instart' from /var/lib/gems/2.3.0/gems/rhc-1.38.7/bin/rhc:20:in <top (required)>' from /usr/local/bin/rhc:23:inload' from /usr/local/bin/rhc:23:in `' edwin@edwin-Lenovo-FLEX-3-1130:~$

What is the correct fix for this. If i get a small.highcpu upgrade or medium cpu under bronze, will this issue still arise if indeed it is related to memory?

1

1 Answers

0
votes

502 is a gateway issue. One of your servers' response is not reached to another server. This happened to me as well.

My project was on Apache and Mysql(5.5). figured out that mysql server was the real issue as my processlist was huge and few of the processes were stuck due to table lock and other issues.

Optimized my DB by specifying proper storage engines like InnoDb and updated mysql to mariadb.

Solved the issue by implementing some caching like memchache which reduced the load on my database server and response was fast.

Try by restarting your servers.

You can also check your both servers' Timeout in case you see 504 error.