-
Notifications
You must be signed in to change notification settings - Fork 2k
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
HTTP2 support #566
Comments
@alubbe I haven't tried the new http2 patch for nginx myself. My hunch is that this should be as transparent as the former SPDY mode. You're welcome to try it out on your side and report back any findings (or even fixes!) :) Thanks! |
Yes, it's quite similar to SPDY. What was the reason location capture doesn't work right now? Is it a fundamental problem? |
@alubbe There's been reports from the community that ngx.location.capture does work with the latest SPDY impl in nginx. I just haven't had the chance to confirm myself and update the docs. As always, you're recommended to try it out yourself. |
I can confirm that it does work with SPDY 👍 |
@alubbe Good to know that. Then we can remove the alert regarding ngx.location.capture* + SPDY in ngx_lua's manual. Thanks for your feedback. |
I have tried using OpenResty-1.9.3.1 with SPDY (3.1) module enabled and noticed that ngx.location.capture* works well for (internal) locations with local files but hangs for locations that have proxy_pass mode. |
I cant remember if I posted this. After the first reports of SPDY + location.capture working I tried it. At first it did work (proxy_pass to remote server + location.capture and ngx.print) in the testing environment, then we moved the code to a staging environment and the production code / configuration - it didnt work. I didnt have time either to find the problem though. |
There is also one other method that doesnt work |
I think nginx 1.9.5 might fit that description? https://www.nginx.com/blog/nginx-1-9-5/ |
I was able to get epoll_ctl() alert resulting in 500 from subrequest issued with ngx.location.capture - only for HTTP/2.0 request (HTTP/1.x works just fine with the same configuration). Here's the debug log and config snippet: https://gist.github.com/defanator/b36d776935fbfdfa8b07 This was nginx/1.9.6 with lua-nginx-module 0.9.16. |
@defanator Thanks for the info. I'll have a look when I have a chance. |
@defanator Good to know. Thanks for the feedback! |
Fixes http/2 issues o openresty/lua-nginx-module#566
@agentzh I have experienced crippling memory leaks when using HTTP/2 and Lua. Disabling HTTP/2 seems to have fixed the issue without any other configuration changes. When the memory leaks it's not traceable using any user land tools. I initially blamed the only other piece of software running on my frontends which is consul from hashicorp, however, after working with them on consul issue #1476 and disabling HTTP/2 that seems unlikely. I have the output of the following commands on here:
I don't mean to hijack this issue, I just want to know what additional information I can provide and provide some warning that under production load HTTP/2 itself works great, but seems to be dangerous to use in combination with Lua. |
@jmealo The ngx_lua module has never been officially tested with HTTP/2. It would be great if you can create a minimized and isolated test case that I can run locally to reproduce the problem. |
any updates to this? |
@leebenson There's no activity on our side since we've been very busy with other things (ngx_stream_lua_module and etc). I'd like to rely on community contributions here. Patches welcome and volunteers welcome :) |
@leebenson @agentzh I am using openresty/1.9.7.1 and the lua-nginx module with HTTP/2 in production with no issues. (The issue I had was unrelated.) I'm running Ubuntu 14.04 x64 (3.13.0-68-generic). I use the following directives:
I use the following OpenResty provided modules: "cjson"
"resty.mysql" I use the following third-party modules: "resty.cookie" -- (from Cloud Flare)
"resty.random" -- (the fork with UUID generation)
"router" -- (router.lua v2.1.0) I use |
@jmealo can you tell as what was causing your issue? I have some problems while testing lua and http2, but I use proxy_pass, rewrite's and try_files to make complex system for live streaming platform. |
@misiek08 I have no issues functionality-wise but when I run OpenResty and consul together on Ubuntu 14.04 there is a kernel memory leak that cannot be reproduced by running either component in isolation. I've been running in productions since November without issues since I removed consul in December. My load balancers have been up the past 68 days (rebooted for upgrade) and average 3-5k connections (HTTP/2, web socket, always-open) without issues. Learning to write memory efficient Lua: Debugging lua running in NGINX: Getting help: Recommended reading: Good luck! |
I have private fork of two bigger modules and I know (basics of?) how nginx
work. I just tried compiling openresty without 3rd party module provided by
my client's developer and after 50 hours everything works perfectly. I'll
try to push more traffic on that but currently it's doing constant 1300
requests per second, so it's stable.
So no problem with HTTP2 support here.
|
@misiek08 Yeah, nginx C programming is hard. Better stick with OpenResty's own C modules whenever possible :) |
I have few own modules, but this one was developed by my client's developer
and guy was doing strange things with allocating memory and passing
offseted pointers.
No more problems with HTTP2 in openresty after fixing 3rd party code.
|
what lua or luaJit version should I select when using http v2, thanks! |
@yaung LuaJIT 2.1 is recommended. It's more recommended to use the OpenResty bundle directly to avoid troubles, especially compatibility issues and building troubles: |
Does the latest version of lua_nginx_module support http2 ? |
@yaung To some extend, yes. |
There are still problems, see #724 |
Yeah, certain features are still problematic in HTTP/2. We'll work on them. |
With regards to a comment on "ngx.location.capture - only for HTTP/2.0 not working", is this fixed by any chance now ? |
With nginx support for HTTP2 on the horizon, what's the plan of supporting it?
Is it likely that everything that works for SPDY will continue to work?
Is there any chance we could also get ngx.location.capture to work? That would be super helpful 👍
The text was updated successfully, but these errors were encountered: