TestFlows-GitHub-Hetzner-Runners icon indicating copy to clipboard operation
TestFlows-GitHub-Hetzner-Runners copied to clipboard

Reduce amount of GET /servers requests

Open jooola opened this issue 1 year ago • 1 comments

I believe this tool currently runs 1 request every 10 seconds to /servers to list all servers present in a project. This might lead to rate limit issues for a user using your tool.

I recommend reducing the amount of requests during normal operation and only query every 10 seconds when an instance is being scaled up/down.

Also, a local cache might be a good option, the cache could be invalidated when deleting/creating an instance.

jooola avatar Dec 09 '24 18:12 jooola

The polling rate can be controlled, but I'm not sure if caching will help. We primarily monitor the server's power ON/OFF state, which requires sending an API request to Hetzner since it can't be determined otherwise. Support for conditional requests in the Hetzner API would make this more efficient, but unfortunately, it's not available at the moment.

vzakaznikov avatar Dec 19 '24 13:12 vzakaznikov