oxidecomputer / cio

Rust libraries for APIs needed by our automated CIO.
Apache License 2.0
263 stars 41 forks source link

CloudFlare Rate Limiting #174

Closed augustuswm closed 2 years ago

augustuswm commented 2 years ago

sync-shorturls (and by extension other functions like sync-other) has started running into CloudFlare rate limiting:

More than 1200 requests per 300 seconds reached. Please wait and consider throttling your request speed

Currently every record performs a list request, and as such can easily exhaust the limit. A few options:

augustuswm commented 2 years ago

Each call to ensure_record seems to make a call to get_zone_identifier which likely requests the same data repeatedly and can be cached.