comparison xml/en/docs/http/ngx_http_upstream_module.xml @ 2191:2c56f91c304a

Documented the "random" directive.
author Vladimir Homutov <vl@nginx.com>
date Fri, 08 Jun 2018 13:58:05 +0300
parents f6e578b1b02d
children 03f8a9c5e8ae
comparison
equal deleted inserted replaced
2190:dfc49994218c 2191:2c56f91c304a
8 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd"> 8 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd">
9 9
10 <module name="Module ngx_http_upstream_module" 10 <module name="Module ngx_http_upstream_module"
11 link="/en/docs/http/ngx_http_upstream_module.html" 11 link="/en/docs/http/ngx_http_upstream_module.html"
12 lang="en" 12 lang="en"
13 rev="70"> 13 rev="71">
14 14
15 <section id="summary"> 15 <section id="summary">
16 16
17 <para> 17 <para>
18 The <literal>ngx_http_upstream_module</literal> module 18 The <literal>ngx_http_upstream_module</literal> module
797 797
798 <note> 798 <note>
799 This directive is available as part of our 799 This directive is available as part of our
800 <commercial_version>commercial subscription</commercial_version>. 800 <commercial_version>commercial subscription</commercial_version>.
801 </note> 801 </note>
802 </para>
803
804 </directive>
805
806
807 <directive name="random">
808 <syntax>[<literal>two</literal> [<value>method</value>]]</syntax>
809 <default/>
810 <context>upstream</context>
811 <appeared-in>1.15.1</appeared-in>
812
813 <para>
814 Specifies that a group should use a load balancing method where a request
815 is passed to a randomly selected server, taking into account weights
816 of servers.
817 </para>
818
819 <para>
820 The optional <literal>two</literal> parameter
821 instructs nginx to randomly select
822 <link url="http://www.eecs.harvard.edu/~michaelm/postscripts/handbook2001.pdf">two</link>
823 servers and then choose a server
824 using the specified <literal>method</literal>.
825 The default method is <literal>least_conn</literal>
826 which passes a request to a server
827 with the least number of active connections.
802 </para> 828 </para>
803 829
804 </directive> 830 </directive>
805 831
806 832