Skip to content
This repository has been archived by the owner on Apr 27, 2021. It is now read-only.

[WIP] EWMA improvements #219

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

[WIP] EWMA improvements #219

wants to merge 1 commit into from

Conversation

ElvinEfendi
Copy link

@ElvinEfendi ElvinEfendi commented Jun 28, 2019

What this PR does / why we need it:
Proof of concept for now.

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #

Special notes for your reviewer:

if slow_start_ewma < ewma then
slow_start_ewma = ewma
end
end
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure whether this is the best heuristic. Maybe 75th percentile value would be better?

local slow_start_ewma = 0
for _, endpoint in pairs(self.peers) do
local endpoint_string = endpoint.address .. ":" .. endpoint.port
local ewma = ngx.shared.balancer_ewma:get(endpoint_string) or 0
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably use get_or_update_ewma to get decayed value.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant