3

We just launched a rails app on heroku and see a lot of connection timeouts to the api. We have a connection timeout of 10 sec. Is it a normal behavior or is it because of too many hits? All queries are authenticated as a user. We query friends/ids and followers/ids only.

We see also timeouts in our reverse auth query done by the same app.

Do somebody already had something like that?

EDIT

Having a support ticket, they told me they were looking with twitter's engineers to avoid blacklist.

  • I have the same issue with Twitter API on Heroku. Waiting for Heroku support ticket response. I'm also having odd things with uploading images to S3 - uploads fine but Heroku 'misses' the successful response and thinks it times out. Odd as both were fine for a year. – Ben Jul 24 '13 at 17:17
  • 1
    Heroku have sent me a couple of replies but no solution yet. Yesterday I had a Twitter API related error 500 every hour throughout the day. At 11PM GMT this stopped and I've not had one since. Seems to be an intermittent issue. Will be interesting to know if you notice a similar pattern. – Ben Jul 25 '13 at 10:30
  • For me it really seems to be linked to the instance it's on, If I restart or force deploy, sometimes it just disappears – yannick Jul 25 '13 at 12:28
1

It appears this is due to Twitter blacklisting Heroku's primary IP addresses. If you are having this issue, please file a ticket with Heroku and comment on this Twitter discussion: https://dev.twitter.com/discussions/20185

1

When you are using the Twitter gem (?) sometimes the connection timeout happens when your DNS server can't resolve the IP of api.twitter.com fast enough. Check your DNS settings @ /etc/resolv.conf

Most the PaaS are using the Google ones (4.4.4.4 or 8.8.8.8) which are rate limited and sometimes very slow...resulting in connection timeouts.

Got the same problem running a Rails app on Cloud66/DigitalOcean. Changed the DNS to some more local ones and the Twitter gem performance like a jaguar.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.