Skip to content

feature: balancer_by_lua_* for stream subsystem #43

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

Closed
wants to merge 3 commits into from

Conversation

doujiang24
Copy link
Member

For now, only set_current_peer and set_more_tries(not respect proxy_next_upstream_tries) are provided.

  1. for get_last_failure, there is only one fail status, so we do not need it?
  2. for set_timeouts
    the connect_timeout only in ngx_stream_proxy_srv_conf_t,
    and it only support proxy_connect_timeout and proxy_timeout (no proxy_read_timeout and proxy_send_tiemout like http system does), so I suggest just mark it to do for now.
  3. for set_more_tries
    Seems we need to patch to the nginx core to get the configured max retry num, so just not respect proxy_next_upstream_tries for now, marked it's todo.

The nginx stream system is growing, so I think it's better to not patch for the nginx base code.

This PR is basically from lua-nginx-module & learn much from @rshriram @splitice #30

@rshriram
Copy link

@doujiang24 I was just about to start addressing your comments. Looks like you beat me to the chase. Glad that you got these issues sorted out. Thank you.

@doujiang24
Copy link
Member Author

@rshriram I needed it to build a dynamic tcp proxy system, and it's online now.
Also will you have a look at it? Thanks for your work too :)

@rshriram
Copy link

@doujiang24 can you possibly point me to your dynamic tcp proxy?
How did you overcome the lack of variable support in tcp subsystem?

@agentzh
Copy link
Member

agentzh commented Oct 28, 2016

@rshriram I think the latest nginx core has got nginx variable support.

@rshriram
Copy link

@agentzh is there any way to combine the balancer_by_lua functionality with nginx features like max_fails, fail_timeout, max_conns (http://nginx.org/en/docs/stream/ngx_stream_upstream_module.html#server) ?

In the same vein, how do I combine lua-resty-upstream-healthcheck (http/tcp) with balancer_by_lua ?

@doujiang24
Copy link
Member Author

@rshriram Sorry, there is no public code.
My dynamic upstreams is loaded by init_worker_by_lua + ngx.timer.at, and don't need variable on my side.

@doujiang24 doujiang24 force-pushed the balancer branch 2 times, most recently from 95fe041 to 7de79f3 Compare November 21, 2016 10:30
…le directives to allow NGINX load balancers written in Lua

Also added pure C API to support the ngx.balancer Lua API implemented in the lua-resty-core library.
@dndx
Copy link
Member

dndx commented Feb 7, 2018

No longer needed.

@dndx dndx closed this Feb 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants