Kong / ngx_wasm_module

Nginx + WebAssembly
Apache License 2.0
79 stars 7 forks source link

perf(http) stash local response in request pool #581

Closed hishamhm closed 1 month ago

hishamhm commented 1 month ago

This is to avoid mounting memory pressure as a longer-lived connection gets reused across many requests.

Before: image

After: image

(The initial peak in both graphs is the Cranelift compilation process.)

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 90.60900%. Comparing base (d6aaf2e) to head (9559a36).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/Kong/ngx_wasm_module/pull/581/graphs/tree.svg?width=650&height=150&src=pr&token=T0PT2Q9IAN&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Kong)](https://app.codecov.io/gh/Kong/ngx_wasm_module/pull/581?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Kong) ```diff @@ Coverage Diff @@ ## main #581 +/- ## =================================================== + Coverage 90.59071% 90.60900% +0.01828% =================================================== Files 49 49 Lines 10936 10936 =================================================== + Hits 9907 9909 +2 + Misses 1029 1027 -2 ``` | [Files](https://app.codecov.io/gh/Kong/ngx_wasm_module/pull/581?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Kong) | Coverage Δ | | |---|---|---| | [src/http/ngx\_http\_wasm\_local\_response.c](https://app.codecov.io/gh/Kong/ngx_wasm_module/pull/581?src=pr&el=tree&filepath=src%2Fhttp%2Fngx_http_wasm_local_response.c&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Kong#diff-c3JjL2h0dHAvbmd4X2h0dHBfd2FzbV9sb2NhbF9yZXNwb25zZS5j) | `85.47009% <100.00000%> (ø)` | | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/Kong/ngx_wasm_module/pull/581/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Kong) | [Flag](https://app.codecov.io/gh/Kong/ngx_wasm_module/pull/581/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Kong) | Coverage Δ | | |---|---|---| | [unit](https://app.codecov.io/gh/Kong/ngx_wasm_module/pull/581/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Kong) | `90.32662% <100.00000%> (ø)` | | | [valgrind](https://app.codecov.io/gh/Kong/ngx_wasm_module/pull/581/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Kong) | `82.13065% <100.00000%> (+0.09045%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Kong#carryforward-flags-in-the-pull-request-comment) to find out more.