Skip to content

Commit 9b314e9

Browse files
authored
util: Change default tracking poll interval (#135)
Changes the default poll period from 1s to 10s, meaning a 10x increase to a slower polling period. Additionally adjusts the number of accepted API failues (404 or timeouts) to only 2 exponential backoffs since now the polling interval is higher which yields the same effect on ensuring that the pending plan has finished without polling the API so many times. This should reduce memory the binary's CPU and network usage as well as reduced API backpressure. Signed-off-by: Marc Lopez <marc5.12@outlook.com>
1 parent 5717785 commit 9b314e9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

pkg/util/track.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@ import (
2828
const (
2929
// DefaultRetries retries for the plan.TrackParams which accounts
3030
// for the Pending plan not being present in the backend, it will retry
31-
// the request the times specified here. 4 is the default anectdotically
32-
// because it provides a maximum sleeping time of (PollFrequency * 2)^4
33-
// or math.Exp2(4). Increasing this value will cause the PlanTracker to
31+
// the request the times specified here. 2 is the default anectdotically
32+
// because it provides a maximum sleeping time of (PollFrequency * 2)^2
33+
// or math.Exp2(2). Increasing this value will cause the PlanTracker to
3434
// sleep for more time than it's required, thus making ecctl less efficient.
35-
DefaultRetries = 4
35+
DefaultRetries = 2
3636

3737
// DefaultPollFrequency is frequency on which the API is polled for updates
3838
// on pending plans. This value is also used as the cooldown time when used
3939
// with MaxRetries > 0.
40-
DefaultPollFrequency = time.Second
40+
DefaultPollFrequency = time.Second * 10
4141
)
4242

4343
// TrackParams are intended to be used as a field in other params structs

0 commit comments

Comments
 (0)