Home > database >  Many sets of mongos attachment under high concurrency
Many sets of mongos attachment under high concurrency

Time:09-24

My usage scenario is more than high concurrent connection mongos, and when the wire specify only a single mongos no problem (app1, app3 mongos1), App2, app4 to mongos mongos2) but when all are listed on the connection string, can also operate mongo. Only when tens of thousands of work finished, suddenly two mongos did not work. The attachment is the mongo shell under instruction will be an error, shows unable to connect, or be rejected the connection information, such as when mongos proess is still alive.

Doubted attachment, use ulimi -n increased the open file limit, also in the mongos config plus net. MaxIncomingConnections 2000. But after rev mongos, mongo shell connected, in repeated a large number of insert (request through middleware), to the serverStatus (). See the available or 818 connections, and insert the same lot, the current will increase the value, until about 300 or so, suddenly died. Looks attachment several changes may not happen; But the connection is not to refuse any client to limit number.

Solving!!!!!

CodePudding user response:

Look at the mongos mongod config error log

CodePudding user response:

Similar situation continues. For example can cause a shard of Primary hang up (the process completely gone) can restart, but the 2019-02-19 T13:36:08. 773 + 0800 NETWORK and hang up soon. I checked the log, the node do see
[the main] - maxConns too high, can only handle 51200 (I have put the ulimit, net. InComingConnections are set to 64000. But after entering the mongo, see the available is 51179). The mongos also use the same Settings

My clients use attachment has set maxPoolSize=100, minPoolSize.=20 MongoClient also use a fixed, and not every time new one to use. In the process of running, the Primary check the connections. The current is continuous at around 300. From 50000 is a long way, will not increase infinite.

Generally see posts are written how to adjust number of dalian. But I have magnified, still happen. What is the client code to adjust or mongo Settings to adjust? How feel mongos to mongod (primary) connection is not connection pool?
  • Related