jiangdongzi opened a new issue, #11735:
URL: https://github.com/apache/apisix/issues/11735
### Current Behavior
function _M.http_access_phase()
local ngx_ctx = ngx.ctx
if not verify_tls_client(ngx_ctx.api_ctx) then
return core.response.exit(400)
end
-- always fetch table from the table pool, we don't need a reused api_ctx
local api_ctx = core.tablepool.fetch("api_ctx", 0, 32)
if true then return end
ngx_ctx.api_ctx = api_ctx
if true then return end
core.ctx.set_vars_meta(api_ctx)
这是我改动的一点apisix中的一段代码,
当代码是这样的时候, 我测试的qps是34840.16
当代码如下的时候
function _M.http_access_phase()
local ngx_ctx = ngx.ctx
if not verify_tls_client(ngx_ctx.api_ctx) then
return core.response.exit(400)
end
-- always fetch table from the table pool, we don't need a reused api_ctx
local api_ctx = core.tablepool.fetch("api_ctx", 0, 32)
if true then return end
----------------------------------------------------------------------------这一句
ngx_ctx.api_ctx = api_ctx
if true then return end
core.ctx.set_vars_meta(api_ctx)
我测试的qps为32786.69
### Expected Behavior
_No response_
### Error Logs
_No response_
### Steps to Reproduce
http {
upstream backend_servers {
server 172.27.255.64:81;
keepalive 16;
}
server {
listen 9085;
server_name localhost;
access_by_lua_block {
apisix.http_access_phase()
}
location / {
proxy_pass http://backend_servers; # 或者使用 proxy_pass
http://backend_servers$request_uri;
proxy_set_header Connection "";
proxy_http_version 1.1;
}
}
这是对应的nginx配置
upstream是个nginx只是返回hello
### Environment
- APISIX version (run `apisix version`):2.13
- Operating system (run `uname -a`):centos
- OpenResty / Nginx version (run `openresty -V` or `nginx -V`):1.25.32
- etcd version, if relevant (run `curl
http://127.0.0.1:9090/v1/server_info`):
- APISIX Dashboard version, if relevant:
- Plugin runner version, for issues related to plugin runners:
- LuaRocks version, for installation issues (run `luarocks --version`):
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]