Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic "Keep around minutes" according to Hetzner's hourly billing cycle #30

Closed
sandrinr opened this issue Jun 8, 2022 · 3 comments · Fixed by #31
Closed

Dynamic "Keep around minutes" according to Hetzner's hourly billing cycle #30

sandrinr opened this issue Jun 8, 2022 · 3 comments · Fixed by #31
Labels
enhancement New feature or request

Comments

@sandrinr
Copy link

sandrinr commented Jun 8, 2022

What feature do you want to see added?

This is a request for an optimization around how Jenkins manages spawned Hetzner server resources. Currently, the plugin lets idle resources stay around for a configurable amount of time of which the default is 10 minutes. This can lead to the situation where multiple nodes are created and torn down within the same hour.

Hetzner bills its server resources on a hourly basis. The customer pays for every started hour. Jenkins normally does not know about the potential future workload it has to cope with. By letting nodes run idle just before a new hour would be started, Jenkins could make maximum use out of the already spawned resources.

Upstream changes

No response

@sandrinr sandrinr added the enhancement New feature or request label Jun 8, 2022
@rkosegi
Copy link
Contributor

rkosegi commented Jun 8, 2022

Hi @sandrinr, thanks for interesting idea.

I can see 2 potential issues here:

  1. If Jenkins controller's clock is skewed
  2. How retention strategy works
    The number of minutes after which the strategy would like to be checked again. The strategy may be rechecked earlier or later than this!

This could lead in theory to consistent over-billing by one hour. So we would probably need some time buffer before whole hour is wrapped.
Will look into to it soon

@rkosegi
Copy link
Contributor

rkosegi commented Jun 10, 2022

With latest release you can now specify 2 different ways of how agent is shutdown.
Default being what was done until now to not break existing installations.

Second option will shutdown agent just before billing cycle completes:
image

As mentioned in comment above, there is safety buffer of 5 minutes.

@sandrinr looking forward for feedback 😉

@rkosegi rkosegi closed this as completed Jun 10, 2022
@sandrinr
Copy link
Author

Thanks a lot @rkosegi for providing this feature so quickly! Looking at our cloud statistics after the upgrade pretty much shows what I would expect.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants