comparison src/core/ngx_resolver.h @ 6366:2e5c027f2a98

Resolver: per-request DNS server balancer. Previously, a global server balancer was used to assign the next DNS server to send a query to. That could lead to a non-uniform distribution of servers per request. A request could be assigned to the same dead server several times in a row and wait longer for a valid server or even time out without being processed. Now each query is sent to all servers sequentially in a circle until a response is received or timeout expires. Initial server for each request is still globally balanced.
author Roman Arutyunyan <arut@nginx.com>
date Thu, 28 Jan 2016 15:28:20 +0300
parents d35b4d590b2d
children 5a16d40c63de
comparison
equal deleted inserted replaced
6365:d35b4d590b2d 6366:2e5c027f2a98
91 91
92 time_t expire; 92 time_t expire;
93 time_t valid; 93 time_t valid;
94 uint32_t ttl; 94 uint32_t ttl;
95 95
96 ngx_uint_t last_connection;
97
96 ngx_resolver_ctx_t *waiting; 98 ngx_resolver_ctx_t *waiting;
97 } ngx_resolver_node_t; 99 } ngx_resolver_node_t;
98 100
99 101
100 typedef struct { 102 typedef struct {