简体   繁体   中英

Google Geocoding API limit exceeded on cell network, but not on wifi

I'm using SVGeocoder to access Google's geocoding services on iOS, and I'm running into a really weird problem. Geocoding works perfectly when testing on the simulator or on a phone connected to wifi, but once the phone is switched to 3G/4G, I start getting "LIMIT EXCEEDED" errors. I've only made a few dozen requests via 3G/4G, no where near the 2500 request limit. What could be going on here?

Thanks in advance!

UPDATE : I ended up solving the issue by delaying the time between each geocode request. I knew that sending requests too quickly could be a problem, but I didn't realize it returned the same QUERY_LIMIT_EXCEEDED message until I read this .

However, this still doesn't answer the question of why it worked on wifi and not on 3G/4G.

It worked in Wifi because you then use your own IP address and provider. In cellular network, you run the requests thru your provider, which generally uses an outgoing proxy. So when Google receive the request, it sees the IP of your provider's proxy for all their customers, not your own IP, unlike in the wifi case.

At least that's the conclusion I ended up with when I got a similar problem too, based on experience and packet capturing.

  • This means that every request that were executed from a cellular network run by your provider would be seem to come from the same IP for Google, thus increasing the number of requests for this given IP, at least from Google servers' point of view. So if both you, your neighbor and other millions of people using the same provider send a request to Google, and this provider use the same outgoing proxy, Google may seem to see the same IP for those millions of people/requests and will consider the quota limit to be reached.

  • If you run the request over your wifi network, you won't go thru your cellular network provider's outgoing proxy and will have your own outgoing IP, and will be able to do much more requests before seing the "LIMIT EXCEEDED" error, as only your own requests are counted.

I believe that in reality that's a bit more complex in fact: your provider probably have multiple outgoing proxies and uses load-balancing to dispatch their customer's requests on them, Google probably has a database knowing the main CN providers's proxies and adjust its quota limit accordingly, etc… but you see the idea.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM