Pages: [1] :: one page |
|
Author |
Thread Statistics | Show CCP posts - 3 post(s) |
Ydnari
Estrale Frontiers Project Wildfire
341
|
Posted - 2014.07.12 12:34:00 -
[1] - Quote
CCP FoxFour posted a rate limit policy a while ago. Linode, which I use as a host, recently moved all their storage to SSDs, and as a result my main app started fetching from the API in bursts fast enough that I was worrying I was sailing close to the limits, at least for a minute or two at a time.
I use the excellent phealng for all API access since it honours cache timers automatically (even when they're harmful - spurious 221's I'm looking at you, see other thread).
So I've added in a basic rate limiter option to it. Commit is available here:
https://github.com/andyhassall/phealng/commit/2b0fbb7ddf1a039fe559cc3924dd7d7676bfeeb2
It's a simple leaky-bucket rate limiter allowing (by default) unthrottled bursts up to 10 requests, and then throttles to 30 requests per second from then on. It uses a file to store last request and bucket capacity, and advisory file locking for exclusive access - if you're on a file system or server setup where advisory file locking doesn't work then this isn't suitable.
It also makes no attempt at fair queueing or FIFO; rate limited requests retry with random sleeps, up to 10 seconds, after which it throws an exception.
Have tried to follow the same principle as other pheal configuration options, so by default it uses a "null" rate limiter, and you can select an implementation to use with:
Config::getInstance()->rateLimiter = new \Pheal\RateLimiter\FileLockRateLimiter()
... optionally passing in a directory where it can write the lock file.
If there's any interest in this I can have a go at contacting the author of pheal and submit a pull request. my teapot is ready |
|
CCP FoxFour
C C P C C P Alliance
3380
|
Posted - 2014.07.12 13:20:00 -
[2] - Quote
Awesome work and thank you for caring! :D
I am sure Peter Powers would be interested in seeing this. You can normally find him on #eve-dev if he doesn't see this directly.
Off topic, how do you like Linode? CCP FoxFour // Game Designer // @regnerba
|
|
Ydnari
Estrale Frontiers Project Wildfire
341
|
Posted - 2014.07.12 14:29:00 -
[3] - Quote
CCP FoxFour wrote:Off topic, how do you like Linode?
Nothing bad to say about them really. On the couple of occasions when they seemed to be underdelivering on price for the VM specs, they've done an upgrade round and doubled memory or storage or changed storage to SSD, and I've ended up not looking for a competitor again.
They aren't quite the cheapest provider around, but I'm happy with them. my teapot is ready |
|
CCP FoxFour
C C P C C P Alliance
3380
|
Posted - 2014.07.12 15:20:00 -
[4] - Quote
Ydnari wrote:CCP FoxFour wrote:Off topic, how do you like Linode? Nothing bad to say about them really. On the couple of occasions when they seemed to be underdelivering on price for the VM specs, they've done an upgrade round and doubled memory or storage or changed storage to SSD, and I've ended up not looking for a competitor again. They aren't quite the cheapest provider around, but I'm happy with them.
Cool looking between them and DigitalOcean. Anyways, back on topic...
CCP FoxFour // Game Designer // @regnerba
|
|
Dragonaire
Here there be Dragons
56
|
Posted - 2014.07.14 21:05:00 -
[5] - Quote
CCP FoxFour - I just notice one API that has a bad cachedUntil time on it, api/CallList has the same time for both currentTime and cachedUntil. That will be wasting everybody's network bandwidth. currentTime>2014-07-14 18:27:20 cachedUntil>2014-07-14 18:27:20
I know there are others but happened to be looking at that one in my cache and noticed it. Finds camping stations from the inside much easier. Designer of Yapeal-á for Eve API. Check out the Yapeal PHP Library thread for more information. |
|
CCP FoxFour
C C P C C P Alliance
3382
|
Posted - 2014.07.15 11:07:00 -
[6] - Quote
Dragonaire wrote:CCP FoxFour - I just notice one API that has a bad cachedUntil time on it, api/CallList has the same time for both currentTime and cachedUntil. That will be wasting everybody's network bandwidth. currentTime>2014-07-14 18:27:20 cachedUntil>2014-07-14 18:27:20
I know there are others but happened to be looking at that one in my cache and noticed it.
Thanks for the heads up. I have added it to my back log. Let me know of any others you find. CCP FoxFour // Game Designer // @regnerba
|
|
Peter Powers
Terrorists of Dimensions Free 2 Play
242
|
Posted - 2014.07.16 15:37:00 -
[7] - Quote
Hello, i'm the maintainer of phealng, and i just looked through your changes. If you want to put in a pull request, i'll merge this feature in.
However, there is something i noticed that i'd like you to take care of first, the code style should be psr-2, you have some brackets wrong, and at least it seems to me as if your using tab..
3rdPartyEve.net - your catalogue for 3rd party applications |
Ydnari
Estrale Frontiers Project Wildfire
342
|
Posted - 2014.07.16 19:12:00 -
[8] - Quote
Thanks, when I get a moment I'll lint it up to PSR-2 and then submit the request. my teapot is ready |
|
|
|
Pages: [1] :: one page |
First page | Previous page | Next page | Last page |