Skip to content
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

Merged
merged 5 commits into from Oct 10, 2013
Merged

Limit proxy/memcached/fastcgi/scgi/uwsgi upstream tries times #322

merged 5 commits into from Oct 10, 2013

Conversation

supertcy
Copy link
Contributor

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.

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"),
Copy link
Member

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.

Copy link
Contributor Author

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.

@yaoweibin
Copy link
Member

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

@supertcy
Copy link
Contributor Author

thank you. will do that in coming vacation ;)

@yaoweibin
Copy link
Member

Looks good to me.

cfsego pushed a commit that referenced this pull request Oct 10, 2013
Limit proxy/memcached/fastcgi/scgi/uwsgi upstream tries times
@cfsego cfsego merged commit 78c4fcb into alibaba:master Oct 10, 2013
@cfsego
Copy link
Member

cfsego commented Jan 9, 2014

能否为next_retries提供一个md文档,介绍模块的使用。提交到tengine的docs/modules下面

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.

None yet

3 participants