0

I'm not sure if it is relevant but I have a tiny app on Heroku on free dynos and it requires extra time to spin up when requested (~20 sec).

My logs have a number of H27 / HTTP 499 warnings in heroku/router on requests originating from ASN IPs registered to Facebook and Cogent. Requests from ASNs belonging to Yandex do not result in HTTP 499s and neither do request from humans.

The traffic isn't unexpected as the app's been shared on Facebook. My hypothesis is social sites check shared posts for update and pull in a preview image periodically.

Is my periodic update assumption is correct? Regardless, why do the result in 499s?

Aaron
  • 103
  • 3

1 Answers1

1

The 499 is a nonstandard error code used by nginx to indicate that the client closed the connection before the server could respond. If the client's timeout is shorter than the time necessary to respond to a request, you will see this error.

These errors will not go away unless the client increases its timeout or you return a response more quickly. Since you do not control the client, you can't really increase the client's timeout. All you can do is try to return a response more quickly. But that would most likely mean moving up from the free tier.

Michael Hampton
  • 237,123
  • 42
  • 477
  • 940
  • Thanks @Michael. In other words 499 is nginx saying that although it has a response to return, the other end hung up. Would it be fair to assume these automated services running on ASNs have a lower timeout than a standard web browser? It would explain the observations and I can't recall when/if I've ever set a timeout on a request either in a library or in my browser's chrome. – Aaron Sep 07 '20 at 19:52
  • 1
    Everything that makes an HTTP request will time out eventually if it doesn't get a response. All [browsers](https://stackoverflow.com/q/39751124/1068283) do it, and your library certainly has a timeout set, even if you didn't change it. – Michael Hampton Sep 07 '20 at 20:00