-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
scheduler: make backoff base and cap configurable #2870
base: master
Are you sure you want to change the base?
Conversation
Demo configuration
|
Logs
|
Valgrind report:
|
Signed-off-by: Abilio Marques <[email protected]>
629f331
to
66c77a4
Compare
Documentation pull request is at: fluent/fluent-bit-docs#435 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for opening this PR.
please re-work the PR with the changes suggested.
@@ -266,8 +266,12 @@ int flb_sched_request_create(struct flb_config *config, void *data, int tries) | |||
timer->event.mask = MK_EVENT_EMPTY; | |||
|
|||
/* Get suggested wait_time for this request */ | |||
seconds = backoff_full_jitter(FLB_SCHED_BASE, FLB_SCHED_CAP, tries); | |||
seconds += 1; | |||
if (config->backoff_base <= 0 || config->backoff_cap <= 0 || config->backoff_base > config->backoff_cap) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this config check should not be done at runtime, it should be done at start time since the values never changes after the service has started.
@@ -56,6 +56,14 @@ struct flb_service_config service_configs[] = { | |||
FLB_CONF_TYPE_INT, | |||
offsetof(struct flb_config, grace)}, | |||
|
|||
{FLB_CONF_STR_BACKOFF_BASE, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
config map first value is wrong, it aims to define the "value type", that value will lead to an undefined behavior.
This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
Currently the backoff limits are hardwired to produce a random number between 5 and 2000 seconds (+1). These numbers are certainly fine for a broad range of applications, but sometimes different ones can produce a quicker response after a long outage, or help an under-powered server survive bigger number of clients. As a reference, Google IoT recommends a backoff cap of 32 or 64 seconds, way under the 2000 s.
These changes allow the user to customize those times.
Enter
[N/A]
in the box, if an item is not applicable to your change.Testing
Before we can approve your change; please submit the following in a comment:
Documentation
Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.