谷歌地理编码API的限制超出了蜂窝网络,但不是在WiFi上 [英] Google Geocoding API limit exceeded on cell network, but not on wifi

查看:164
本文介绍了谷歌地理编码API的限制超出了蜂窝网络,但不是在WiFi上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 SVGeocoder 访问Google iOS上的Google地理编码服务,并且遇到了真奇怪的问题。地理编码在模拟器或连接到wifi的手机上测试时效果很好,但一旦手机切换到3G / 4G,我开始出现LIMIT EXCEEDED错误。我只通过3G / 4G发出了几十个请求,没有接近2500的请求限制。可能会发生什么情况?



预先感谢!


$ b

更新:我最终通过延迟每个地理编码请求之间的时间来解决问题。我知道发送请求过快可能会造成问题,但我不知道它会返回相同的QUERY_LIMIT_EXCEEDED消息直到我读到这个

然而,这仍然不能回答为什么它在wifi上工作而不是在3G / 4G。

解决方案

它在Wifi中工作,因为您使用自己的IP地址和提供商。
在蜂窝网络中,您通过您的提供商运行请求,该提供商通常使用外发代理。因此,当Google收到请求时,它会看到您的提供商的所有客户的代理的IP,而不是您自己的IP,与wifi无关。



至少这是结论我最终也遇到了类似的问题,基于经验和数据包捕获。




  • 这意味着每个请求从您的提供商运行的蜂窝网络执行的内容似乎来自Google的相同IP,因此至少从Google服务器的角度来看,这会增加针对此给定IP的请求数量。因此,如果您,您的邻居和其他数百万使用相同提供商的人向Google发送请求,并且此提供商使用相同的外发代理,那么Google似乎可以为数百万人/请求看到相同的IP,并且会考虑如果你通过你的wifi网络运行这个请求,你将不会通过你的移动网络提供商的外发代理,并且会让你的拥有即将离任的IP,并且在能够处理LIMIT EXCEEDED错误之前可以做更多的请求,因为只有您自己的请求被计算在内。


  • 我相信事实上这实际上有点复杂:您的提供者可能有多个传出代理并使用负载均衡来分派客户的请求,但Google可能有一个数据库主要的CN提供商的代理商,并相应地调整配额限制,等等......但你看到了这个主意。


    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.

    这篇关于谷歌地理编码API的限制超出了蜂窝网络,但不是在WiFi上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆