lua-nginx-module icon indicating copy to clipboard operation
lua-nginx-module copied to clipboard

use ngx_hash_t to optimize the header look-up for ngx.req.set_header

Open rako9000 opened this issue 9 years ago • 9 comments

use ngx_hash_t to optimize the header look-up for ngx.req.set_header and clear_header, if this is ok, i will port it to "ngx.header.HEADER"

I have run the testsuite like this: ps: the dav_methods error is not caused by this commit.

rako@t450s:~/gitroot/rako9000/lua-nginx-module$ prove -I/opt/openresty/test-nginx/lib t/028-req-header.t t/028-req-header.t .. 145/256 nginx: [emerg] unknown directive "dav_methods" in /home/rako/gitroot/rako9000/lua-nginx-module/t/servroot/conf/nginx.conf:43 Bailout called. Further testing stopped: TEST 49: set the Destination request header for WebDav - Cannot start nginx using command "nginx -p /home/rako/gitroot/rako9000/lua-nginx-module/t/servroot/ -c /home/rako/gitroot/rako9000/lua-nginx-module/t/servroot/conf/nginx.conf > /dev/null" (status code 256). FAILED--Further testing stopped: TEST 49: set the Destination request header for WebDav - Cannot start nginx using command "nginx -p /home/rako/gitroot/rako9000/lua-nginx-module/t/servroot/ -c /home/rako/gitroot/rako9000/lua-nginx-module/t/servroot/conf/nginx.conf > /dev/null" (status code 256). rako@t450s:~/gitroot/rako9000/lua-nginx-module$ prove -I/opt/openresty/test-nginx/lib t/111-req-header-ua.t t/111-req-header-ua.t .. ok
All tests successful. Files=1, Tests=144, 3 wallclock secs ( 0.04 usr 0.00 sys + 0.19 cusr 0.06 csys = 0.29 CPU) Result: PASS rako@t450s:~/gitroot/rako9000/lua-nginx-module$ prove -I/opt/openresty/test-nginx/lib t/112-req-header-conn.t t/112-req-header-conn.t .. ok
All tests successful. Files=1, Tests=32, 1 wallclock secs ( 0.02 usr 0.00 sys + 0.12 cusr 0.02 csys = 0.16 CPU) Result: PASS rako@t450s:~/gitroot/rako9000/lua-nginx-module$ prove -I/opt/openresty/test-nginx/lib t/113-req-header-cookie.t t/113-req-header-cookie.t .. ok
All tests successful. Files=1, Tests=48, 1 wallclock secs ( 0.03 usr 0.00 sys + 0.12 cusr 0.03 csys = 0.18 CPU) Result: PASS

rako9000 avatar Jun 22 '16 07:06 rako9000

@rako9000 Thanks for looking into this. But the Travis CI testing is failing:

https://travis-ci.org/openresty/lua-nginx-module/builds/139419383

Seems like your change leads to a lot of nginx warnings. That is,

nginx: [warn] could not build optimal req_set_header_hash, you should increase either req_set_header_hash_max_size: 100 or req_set_header_hash_bucket_size: 43; ignoring req_set_header_hash_bucket_size

Maybe you should tune to hash table parameters a bit?

agentzh avatar Jun 22 '16 19:06 agentzh

@agentzh I am sorry for this warning, and I made small changes to this, but I have two question:

  1. My config is this "error_log logs/error.log info;", but there is no warning message in the error log like that. How can I get this warning? 2.It's about git usage. for this second commit, It seems like the github pull request automatically?

rako9000 avatar Jun 23 '16 06:06 rako9000

@agentzh The ci errors seem like dns problem, not a code bug. What should I do?

rako9000 avatar Jul 22 '16 03:07 rako9000

This pull request is now in conflict :(

mergify[bot] avatar Jun 26 '20 00:06 mergify[bot]

This pull request is now in conflict :(

mergify[bot] avatar Mar 20 '23 09:03 mergify[bot]

This pull request is now in conflict :(

mergify[bot] avatar May 10 '23 14:05 mergify[bot]

This pull request is now in conflict :(

mergify[bot] avatar Sep 23 '23 00:09 mergify[bot]

This pull request is now in conflict :(

mergify[bot] avatar Mar 06 '24 04:03 mergify[bot]