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

The metrics refresh time might be much larger than the refreshMetricsInterval #99

Open
spacewander opened this issue Dec 14, 2024 · 4 comments · May be fixed by #207
Open

The metrics refresh time might be much larger than the refreshMetricsInterval #99

spacewander opened this issue Dec 14, 2024 · 4 comments · May be fixed by #207

Comments

@spacewander
Copy link
Contributor

In the current implementation, the pod metrics get refreshed for each refreshMetricsInterval + the time of refreshMetrics:
https://github.com/kubernetes-sigs/llm-instance-gateway/blob/918960cf7f4b2d53d912e6a08b7378f20d20bef7/pkg/ext-proc/backend/provider.go#L82-L87

As the fetchMetricsTimeout is 5s, when the refresh is aborted because of the timeout that happened in one of the requests, the time of refreshMetrics will be 5s. This time is much larger than the refreshMetricsInterval. As a result, stale info would be used for seconds.

One of the solution may be using a separate refresh loop per pod, so a timed-out pod metrics refresh request would not affect other requests. And we may drop the pod which can't provide up-to-date metrics.

@spacewander
Copy link
Contributor Author

Friendly ping @liu-cong @ahg-g
What do you think about that?

@liu-cong
Copy link
Contributor

liu-cong commented Jan 7, 2025

Hi @spacewander , thanks for raising this! I think using a separate refresh loop per pod makes sense.

@spacewander
Copy link
Contributor Author

@liu-cong
I rethought the per-pod solution. As the pod is added dynamically, per-pod fetch with a fixed refresh interval can't guarantee the each pod's fetched metrics are in the same time range. So, I just ensure the fetch time is within the time interval without changing the process: #207

@liu-cong
Copy link
Contributor

per-pod fetch with a fixed refresh interval can't guarantee the each pod's fetched metrics are in the same time range.

Right, but this is fine? Can you elaborate why this is bad?

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

Successfully merging a pull request may close this issue.

2 participants