Open MohammadrezaNasrabadi opened 3 weeks ago
From what I remember from a while back, close-wait means the remote client closed the connection, then, our (server) kernel found out about it, and is now waiting on the application code (CouchDB) to notice as well and close it.
So, perhaps maybe that one node is overwhelmed, sometimes is blocked? (maybe a firewall?), or not getting enough CPU time to run?. Check your resource usage (cpu, memory, open file handles) and the logs to see if there are exceptions or errors on that one node. At least you have a few other nodes to compare to where this doesn't happen.
We don't apply any configuration about the firewall to have limitation or control over the connections.
On the other hand, We didn't see huge CPU or RAM usage on the nodes hosting CouchDB.
Do you have any benchmark results based on the number of shards, replicas, amount of database requests and the available resources? It will be useful to compare our CouchDB infrastructure status with the ideal resource requirements.
I will share the detailed information of our infrastructure if needed.
It's hard to compare architectures, it depends on the requirements. For instance some of our larger clusters have 30+ nodes and our load balancer handles 100k concurrent open connections. Even there, on the load balancer usually there almost no CLOSE_WAIT connections. At most I could see a short temporary increase in CLOSE_WAIT up to 3k out of 100k established connections, then they get cleared back to a few hundred only.
It's good that your resource usage is low it seems. Since you have other nodes to compare to, and others don't seem to show the same behavior try to see what's different between them (configuration, hardware resources). Maybe check your logs for any errors on some vs others?
Title: Too Many Pending Connections
On a Couchdb cluster with three nodes, the number of connections in CLOSE-WAIT state to one of the nodes gradually increases. This is what I get right now (Couchdb has been running for about four days):
Maybe Couchdb does not close connections sometimes? We use Couchdb 3.3.3.