Cyaga
1 decade ago
[Resolved] Connection Refused
Greetings,

I was wondering if anyone could give some information about the current rate limits. I currently have an application running on Heroku, and I'm getting the following error when I try to make a request to the realm status API:

Errno::ECONNREFUSED: Connection refused - connect(2)

Using the same code from my personal computer results in no error; it's only from Heroku's server that this error occurs. I am assuming that I'm hitting some sort of limit for that IP? Here is the minimal example (in Ruby):

>> api = 'http://us.battle.net/api/wow/realm/status'
=> "http://us.battle.net/api/wow/realm/status"
>> uri = URI.parse api
=> #<URI::HTTP:0x2b7d0996a030 URL:http://us.battle.net/api/wow/realm/status>
>> json = Net::HTTP.get uri
Errno::ECONNREFUSED: Connection refused - connect(2)
/usr/ruby1.8.7/lib/ruby/1.8/net/http.rb:560:in `initialize'
/usr/ruby1.8.7/lib/ruby/1.8/net/http.rb:560:in `open'
/usr/ruby1.8.7/lib/ruby/1.8/net/http.rb:560:in `connect'
/usr/ruby1.8.7/lib/ruby/1.8/timeout.rb:53:in `timeout'


Am I on the right track here, or is there something else going on?

Thanks in advance!

[Edit] Restarting the app (and thus launching it on a new IP) seems to have fixed the issue. It seems odd that I would hit a rate limit, as (1) the data is cached in memcache for 5 minutes before it tries to download again, and (2) if the app is idle for a while (half an hour or so?), Heroku spins down the instance and it comes up again on a new IP the next time it's accessed. So, I'm definitely interested in any thoughts or info. Thanks again!
Edited by Cyaga on 4/14/2011 1:14 PM PDT
Osundir
Web & Mobile Team
1 decade ago
[Resolved] Connection Refused
Hi Cyaga!

First - love the new app - I'm with Straton - very excited to see early adoption of the new API :)

It doesn't sound like you should be hitting any sort of throttling on our side - there may be a couple of other reasons for this - if this happens again, please record the IP - we have some other mechanisms that may have blacklisted the IP range your app has spun up from (Generally if its our application-level throttling in action, you'll get a 503 error code as opposed to a Connection Refused).

I'll consult with Straton and our Network folks tomorrow, but feel free to follow up with any other issues.

Thanks again!
Korale
1 decade ago
[Resolved] Connection Refused
Resource interpreted as Script but transferred with MIME type application/json.


I'm guessing that the mime type should be different for a jsonp return (text/javascript) - I've not played around with JSONP before so I might be understanding it wrong.

Anyway - glad to see some progress on the new api and look forward to more being released in the future!


This has been resolved and will go out with the next deployment.
Edited by Straton 04/14/2011 02:12 PM
Currently Ranked: News