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

precision of responseMsec #301

Open
jingyuan66 opened this issue Oct 22, 2024 · 2 comments
Open

precision of responseMsec #301

jingyuan66 opened this issue Oct 22, 2024 · 2 comments

Comments

@jingyuan66
Copy link

Hello!
The precision of responseMsec is too small, and the response time is too short, resulting in a response time of 0ms. Is there any way to change this?

image

@u5surf
Copy link
Collaborator

u5surf commented Oct 29, 2024

@jingyuan66 Hi, Thanks submit the issue. Unfortunately the upstream responseMsec has been depended by nginx upstream module, its precision cannot change any way from this module.
https://github.com/nginx/nginx/blob/f45c2707ea1bf6fde3bd0c045cc4a63cdc4a966a/src/http/ngx_http_upstream.c#L5796-L5804

@jingyuan66
Copy link
Author

Thank you for the quick response and the information on the fixed precision of the nginx upstream module for response times.
I also want to explore another way to obtain the response time data. I considering using following prometheus query:
sum(rate(nginx_vts_upstream_response_seconds_total[1m])) by (backend) * 1000 / sum(rate(nginx_vts_upstream_requests_total[1m])) by (backend)
this query calculates the average response time in milliseconds for each backend by summing the response times and dividing by request count over the past minute. Would this effectively provide the precision I need?
Thank you again for your help!

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

No branches or pull requests

2 participants