-
Notifications
You must be signed in to change notification settings - Fork 22
feat(vars): index upstream timing variables for FFI access #105
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
Conversation
c4b5566
to
fde2099
Compare
A temporary solution is using directive |
After we merged this nginx patch in OSS, a test is failing consistently: https://github.com/Kong/lua-kong-nginx-module/actions/runs/13846604773/job/38746240223#step:8:42
It seems related to the patch in the sense that the new timestamp variables we added are causing the upstream state to be reset or modified in a way that affects connection caching behavior because the test expects to see a cached connection being used. @chronolaw @samugi |
looks to be unrelated to the nginx patch, probably related to the OpenResty bump - moving the conversation internally |
fde2099
to
1c7d91d
Compare
We have identified a ~5% RPS performance regression in the PR Kong/kong-ee#11452 Upon further investigation, we found that a big chunk of CPU time is spent on ngx.var variables access. We add upstream timing variables to the default indexed variables list, allowing efficient access through Kong's FFI interface. These variables track detailed timing information for upstream connections: * upstream_start_timestamp_us * upstream_connect_timestamp_us * upstream_request_timestamp_us * upstream_header_timestamp_us * upstream_response_timestamp_us These microsecond-precision timestamps enable detailed upstream latency analysis and troubleshooting of connection issues.
1c7d91d
to
b7b0bda
Compare
We have identified a ~5% RPS performance regression in the Kong EE PR 11452
Upon further investigation, we found that a big chunk of CPU time is spent on ngx.var variables access.
We add upstream timing variables to the default indexed variables list, allowing efficient access through Kong's FFI interface. These variables track detailed timing information for upstream connections:
These microsecond-precision timestamps enable detailed upstream latency analysis and troubleshooting of connection issues.