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
Limit proxy/memcached/fastcgi/scgi/uwsgi upstream tries times #322
Conversation
proxy_next_upstream retry times. This directive can work in main/server/http/location config, and is disabled by default(default behavior is to try ALL upstreams). Partial code is forked from patch: https://gist.github.com/shai-d/5446961.
@@ -437,6 +437,13 @@ static char *ngx_http_fastcgi_lowat_check(ngx_conf_t *cf, void *post, | |||
offsetof(ngx_http_fastcgi_loc_conf_t, upstream.next_upstream), | |||
&ngx_http_fastcgi_next_upstream_masks }, | |||
|
|||
{ ngx_string("fastcgi_upstream_tries"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the directive name fastcgi_next_tries
better? It matches with the directive fastcgi_next_upstream
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, xxx_next_tries matches xxx_next_upstream better. however, i think maybe xxx_upstream_tries presents the directive function better. xxx_next_tries may confuse users: when tries number is 1, there is no "next_tries", this is 1 upstream_tries.
Thank you for the contribution. Could you add some test cases for this patch? See this case as an example: https://github.com/alibaba/tengine/pull/318/files#diff-2 |
thank you. will do that in coming vacation ;) |
Looks good to me. |
Limit proxy/memcached/fastcgi/scgi/uwsgi upstream tries times
能否为next_retries提供一个md文档,介绍模块的使用。提交到tengine的docs/modules下面 |
Add proxy/memcached/fastcgi/scgi/uwsgi_upstream_tries directives which can limit proxy/memcached/fastcgi/scgi/uwsgi upstream tries times. These directives can work in main/server/location configs, and are disabled by default(default behavior is to try ALL upstreams). Partial code is
forked from patch: https://gist.github.com/shai-d/5446961.