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

perf(request-debugging): improve performance #11722

Merged
merged 2 commits into from
Oct 12, 2023
Merged

Conversation

ADD-SP
Copy link
Contributor

@ADD-SP ADD-SP commented Oct 10, 2023

Please SQUASH AND MERGE

Summary

Improve the performance of the request debugging feature.

Checklist

  • [N/A] The Pull Request has tests
  • [N/A] A changelog file has been created under changelog/unreleased/kong or skip-changelog label added on PR if changelog is unnecessary. README.md
  • [N/A] There is a user-facing docs PR against https://github.com/Kong/docs.konghq.com - PUT DOCS PR HERE

Full changelog

  • reduce the number of calls of ngx.ctx
  • cache some functions at the module level
  • delete debug request headers only when debug headers exist.
  • reduce the number of calls of req_dyn_hook.runhooks().

Issue reference

KAG-2738

@ADD-SP ADD-SP marked this pull request as ready for review October 10, 2023 07:32
@ADD-SP ADD-SP marked this pull request as draft October 10, 2023 07:32
@ADD-SP ADD-SP added this to the 3.5.0 milestone Oct 10, 2023
@@ -58,6 +58,9 @@ log_format kong_log_format '$remote_addr - $remote_user [$time_local] '

# Load variable indexes
lua_kong_load_var_index default;
lua_kong_load_var_index $http_x_kong_request_debug;
Copy link
Contributor

@chronolaw chronolaw Oct 11, 2023

Choose a reason for hiding this comment

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

If we do need these variables we could index them in lua-kong-module by default in the future.

@ADD-SP ADD-SP marked this pull request as ready for review October 11, 2023 07:22
@chobits chobits self-requested a review October 12, 2023 03:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants