Hello!
On Tue, Apr 21, 2015 at 3:08 AM, David Birdsong wrote:
> Hi, I'd like to make upstream decisions based on current connection counts
> or even better, upstream connection counts.
>
Have you looked at the standard least connection upstream balancer module?
http://nginx.org/en/docs/http/ngx_http_upstream_module.html#least_conn
Also, the standard ngx_limit_conn module may also be relevant here:
http://nginx.org/en/docs/http/ngx_http_limit_conn_module.html
> I haven't found any variables supplied by nginx core that could help me
> track. Does such a value exist? Is there some API that I can read to count
> connections?
>
See above.
FWIW, once the balancer_by_lua directive of the ngx_lua module is
opensourced (it is already implemented internally in CloudFlare), such
tasks would be trivial for a little bit of Lua :)
Best regards,
-agentzh