Currently using NGINX as a load balancer for an upstream to a sharded mongo cluster.
.conf reads:
stream {
upstream prodapp_mongo {
least_conn;
server xxx.xxx.xxx.xxx:27017;
server xxx.xxx.xxx.xxx:27017;
server xxx.xxx.xxx.xxx:27017;
}
server {
listen 27017;
proxy_connect_timeout 25s;
proxy_timeout 60s;
proxy_pass prodapp_mongo;
error_log /var/log/nginx/mongo.error.log;
}
}
stub_status output:
Active connections: 15751
server accepts handled requests
15070690 15070506 129824
Reading: 0 Writing: 2 Waiting: 0
The number of active connections seems to be pegged around 15k for about 14 hours and I am concerned as to why they are not in a state of reading/writing/waiting.
Our data-dog reports show a steady increase of connections over this time period and I'm trying to further dig into "why" there are so many active connections, and what are these doing?