Welcome! Log In Create A New Profile

Advanced

Re: [PATCH] Random peer selection for implicit upstream defined by proxy_pass

Anton Jouline
August 27, 2012 11:46AM
Just realized the patch in the previous message was not
in the most-readable form... Here is the shorter version of the diff
with new files omitted. (If anyone's interested, you can see the new
files in the full diff, attached to the original message. These files -
ngx_http_upstream_random.h and ngx_http_upstream_random.c -
are, for the most part, pretty much copies of ngx_http_upstream_round_robin.*,
with some slight changes).

====

diff -u -r nginx-1.2.2-org/auto/sources nginx-1.2.2/auto/sources
--- nginx-1.2.2-org/auto/sources 2012-07-02 09:41:13.000000000 -0700
+++ nginx-1.2.2/auto/sources 2012-08-27 08:31:45.000000000 -0700
@@ -291,6 +291,7 @@
src/http/ngx_http_script.h \
src/http/ngx_http_upstream.h \
src/http/ngx_http_upstream_round_robin.h \
+ src/http/ngx_http_upstream_random.h \
src/http/ngx_http_busy_lock.h"

HTTP_SRCS="src/http/ngx_http.c \
@@ -307,6 +308,7 @@
src/http/ngx_http_script.c \
src/http/ngx_http_upstream.c \
src/http/ngx_http_upstream_round_robin.c \
+ src/http/ngx_http_upstream_random.c \
src/http/ngx_http_parse_time.c \
src/http/modules/ngx_http_static_module.c \
src/http/modules/ngx_http_index_module.c \
diff -u -r nginx-1.2.2-org/src/http/ngx_http.h nginx-1.2.2/src/http/ngx_http.h
--- nginx-1.2.2-org/src/http/ngx_http.h 2012-01-18 07:07:43.000000000 -0800
+++ nginx-1.2.2/src/http/ngx_http.h 2012-08-27 08:31:45.000000000 -0700
@@ -29,6 +29,7 @@
#include <ngx_http_request.h>
#include <ngx_http_upstream.h>
#include <ngx_http_upstream_round_robin.h>
+#include <ngx_http_upstream_random.h>
#include <ngx_http_config.h>
#include <ngx_http_busy_lock.h>
#include <ngx_http_script.h>
diff -u -r nginx-1.2.2-org/src/http/ngx_http_upstream.c
nginx-1.2.2/src/http/ngx_http_upstream.c
--- nginx-1.2.2-org/src/http/ngx_http_upstream.c 2012-07-02
08:43:50.000000000 -0700
+++ nginx-1.2.2/src/http/ngx_http_upstream.c 2012-08-27 08:31:45.000000000 -0700
@@ -895,7 +895,7 @@
}
#endif

- if (ngx_http_upstream_create_round_robin_peer(r, ur) != NGX_OK) {
+ if (ngx_http_upstream_create_random_peer(r, ur) != NGX_OK) {
ngx_http_upstream_finalize_request(r, u,
NGX_HTTP_INTERNAL_SERVER_ERROR);
return;
Only in nginx-1.2.2/src/http: ngx_http_upstream_random.c
Only in nginx-1.2.2/src/http: ngx_http_upstream_random.h

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

[PATCH] Random peer selection for implicit upstream defined by proxy_pass Attachments

Anton Jouline 1417 August 21, 2012 02:38PM

Re: [PATCH] Random peer selection for implicit upstream defined by proxy_pass

Anton Jouline 655 August 27, 2012 11:46AM

Re: [PATCH] Random peer selection for implicit upstream defined by proxy_pass

Maxim Dounin 540 September 07, 2012 10:46AM

Re: [PATCH] Random peer selection for implicit upstream defined by proxy_pass

Anton Jouline 591 September 08, 2012 04:20AM

Re: [PATCH] Random peer selection for implicit upstream defined by proxy_pass

Maxim Dounin 530 September 19, 2012 11:26AM

Re: [PATCH] Random peer selection for implicit upstream defined by proxy_pass

Anton Jouline 539 September 20, 2012 01:40AM

Re: [PATCH] Random peer selection for implicit upstream defined by proxy_pass

Maxim Dounin 518 September 28, 2012 02:52PM

Re: [PATCH] Random peer selection for implicit upstream defined by proxy_pass

Anton Jouline 483 September 28, 2012 04:10PM

Re: [PATCH] Random peer selection for implicit upstream defined by proxy_pass

Maxim Dounin 646 September 29, 2012 03:26AM

Re: [PATCH] Random peer selection for implicit upstream defined by proxy_pass

Anton Jouline 519 September 15, 2012 12:22PM



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

Online Users

Guests: 144
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