503 Service Not available, but hero logs show 200

I am making an expensive call to the Heroku Rails server. After 13-15 seconds, the console in my browser reports a Service Unavailable 503 error. However, when I check my hero’s logs, it reports:

Completed 200 OK in 45592ms (Views: 220.3ms | ActiveRecord: 33457.5ms) 

In other cases, heroku logs report a memory quota exceeded. Below is an example of this.

 2015-06-11T15:17:20.238285+00:00 app[web.1]: Completed 200 OK in 81881ms (Views: 201.6ms | ActiveRecord: 18021.2ms) 2015-06-11T15:17:33.482930+00:00 heroku[web.1]: Process running mem=841M(164.4%) 2015-06-11T15:17:33.482930+00:00 heroku[web.1]: Error R14 (Memory quota exceeded) 2015-06-11T15:17:53.147570+00:00 heroku[web.1]: Process running mem=841M(164.4%) 2015-06-11T15:17:53.147679+00:00 heroku[web.1]: Error R14 (Memory quota exceeded) 2015-06-11T15:17:59.751540+00:00 app[web.1]: E, [2015-06-11T15:17:59.695813 #3] ERROR -- : worker=2 PID:13 timeout (121s > 120s), killing 2015-06-11T15:17:59.916750+00:00 app[web.1]: E, [2015-06-11T15:17:59.906435 #3] ERROR -- : reaped #<Process::Status: pid 13 SIGKILL (signal 9)> worker=2 2015-06-11T15:18:02.487428+00:00 app[web.1]: I, [2015-06-11T15:18:02.427293 #16] INFO -- : worker=2 ready 

Why is it reporting completed 200 when the console reports 503?

+5
source share
2 answers

there are two different things here:

  • your application
  • hero load balancing

In this case, the load balancer sees that the request takes too much time and sends you 503. Otherwise, the service processes the request and returns complete with 200.

Cm:

https://devcenter.heroku.com/articles/limits

https://devcenter.heroku.com/articles/request-timeout

+2
source

Heroku does not give us much information for error-code = H10 . Simple put, something is wrong with your application code / configuration. To find out what is going wrong, run heroku run rails console and you can see the error information to help you fix the error. No need to use magazines. heroku run rails console - great help

0
source

All Articles