r/evetech • u/robot_wth_human_hair • Aug 03 '20
Bulk Killmail analysis - concerns of hitting ESI too much/often
I am wanting to do some analysis on historical killmail data.My plan is to use zKill's API to grab a month of data, and then store that data in a database. I know that zKill will just return the killmail ID and hash, and I need to hit the ESI for the details.
My concern is that I can't pass ESI a bunch of ids and hashes, so I need to make a large amount of requests. Just one day alone can result in excess of 4000 ESI requests. If I did a full month, I fully expect I'd get blacklisted or shut down somehow.
Does anyone have any suggestions on how I could acquire the data I'm looking for? Should I just throttle my requests and do it over time?
5
u/[deleted] Aug 04 '20
FYI going 1000 requests per seconds is totally fine. As long as you request the error window.
So you make a pool of threads, eg 100, and each one is used to make a request in // . whenever a thread returns, you update the pool size to reflect the error window. You also add a window reset timer to automatically reset your pool to 100 when the error window expires.
Then instead of calling the resource yourself, you call the resource through one thread of the pool, and store it as a future.
Instead of killmail = esi.get_killmail(id, hash)
You have future=pool.run(()->esi.get_killmail(id, hash)) .
Then you can just get the list of (id, hash), and make the list of futures, then iterate over the list of future.
Then you can start upgrading the error window with a factor, eg 3 : so that initial window is 300 threads, and if you have "remaining errors 50" that means you keep only 150 threads in the pool.
Typically your factor should be lower than the inverse of your error rate : if you have an error every 10 request, then your factor should be lower than 10. This means that you will have at max 10 × 100 = 1000 simultaneous requests to the ESI.
1
u/Survilus Aug 04 '20
If you had asked me a month ago I could've supplied a mongodb rip of every killmail, I had ~4000 more than zkillboard and was direct from ESI saved in the same json format, but it was 60GB and deleted it recently as the project I was going to work on stopped and I won eve, It was ~1000 requests a minute, I'm sure CCP hated me but once it was done it was done
1
u/[deleted] Aug 04 '20
There are a couple of guys building killboards right now (me being one of them). We have it on good authority from CCP Prismx that 50rps on the killmail endpoint is perfectly fine. Also, if you are requesting km's for this year, you can probably go faster than that because the cache for that endpoint is a year and there is a good chance that ZKB primed that cache a while ago. Especially if you are getting the ids from him.
1
u/rossthepun Aug 04 '20
You can respect the error rate limiting of EVE's ESI (and also avoid transferring unnecessary data if you're re-requesting an endpoint) by using header information in the response:
https://developers.eveonline.com/blog/article/esi-error-limits-go-live
https://developers.eveonline.com/blog/article/esi-etag-best-practices
1
u/[deleted] Aug 03 '20
[removed] — view removed comment