Welcome! Log In Create A New Profile

Advanced

[nginx] svn commit: r4695 - trunk/src/http/modules

Anonymous User
June 18, 2012 10:24AM
Author: mdounin
Date: 2012-06-18 14:23:42 +0000 (Mon, 18 Jun 2012)
New Revision: 4695
URL: http://trac.nginx.org/nginx/changeset/4695/nginx

Log:
Upstream keepalive: "single" parameter deprecated.

The original idea was to optimize edge cases in case of interchangeable
backends, i.e. don't establish a new connection if we have any one
cached. This causes more harm than good though, as it screws up
underlying balancer's idea about backends used and may result in
various unexpected problems.


Modified:
trunk/src/http/modules/ngx_http_upstream_keepalive_module.c

Modified: trunk/src/http/modules/ngx_http_upstream_keepalive_module.c
===================================================================
--- trunk/src/http/modules/ngx_http_upstream_keepalive_module.c 2012-06-18 14:12:03 UTC (rev 4694)
+++ trunk/src/http/modules/ngx_http_upstream_keepalive_module.c 2012-06-18 14:23:42 UTC (rev 4695)
@@ -12,7 +12,6 @@

typedef struct {
ngx_uint_t max_cached;
- ngx_uint_t single; /* unsigned:1 */

ngx_queue_t cache;
ngx_queue_t free;
@@ -223,36 +222,11 @@

kp->failed = 0;

- /* single pool of cached connections */
+ /* ask balancer */

- if (kp->conf->single && !ngx_queue_empty(&kp->conf->cache)) {
-
- q = ngx_queue_head(&kp->conf->cache);
-
- item = ngx_queue_data(q, ngx_http_upstream_keepalive_cache_t, queue);
- c = item->connection;
-
- ngx_queue_remove(q);
- ngx_queue_insert_head(&kp->conf->free, q);
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0,
- "get keepalive peer: using connection %p", c);
-
- c->idle = 0;
- c->log = pc->log;
- c->read->log = pc->log;
- c->write->log = pc->log;
- c->pool->log = pc->log;
-
- pc->connection = c;
- pc->cached = 1;
-
- return NGX_DONE;
- }
-
rc = kp->original_get_peer(pc, kp->data);

- if (kp->conf->single || rc != NGX_OK) {
+ if (rc != NGX_OK) {
return rc;
}

@@ -552,7 +526,8 @@
for (i = 2; i < cf->args->nelts; i++) {

if (ngx_strcmp(value[i].data, "single") == 0) {
- kcf->single = 1;
+ ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
+ "the \"single\" parameter is deprecated");
continue;
}


_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] svn commit: r4695 - trunk/src/http/modules

Anonymous User 1583 June 18, 2012 10:24AM

Re: [nginx] svn commit: r4695 - trunk/src/http/modules

Gena Makhomed 475 June 18, 2012 11:26AM

Re: [nginx] svn commit: r4695 - trunk/src/http/modules

Maxim Dounin 627 June 18, 2012 12:00PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 163
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready