MongoDB .NET Driver 1.1 Bug导致MongoDB拒绝连接
现象: 触发这个bug,你会得到类似于以下的MongoDB错误日志 Fri Sep 28 06:37:21 [initandlisten] connection accepted from xx.xx.xx.xx:64034 #1073 (1014 connections now open) Fri Sep 28 06:37:21 [initandlisten] pthread_create failed: errno:11 Resource temporarily unavailable Fri Sep 28 06:37:21 [initandlisten] can't create new thread, closing connection 直接原因是驱动创建了过多的数据库连接。对于Linux系统来说,一个用户最多能创建的进程数是 ulimit -u 也就是说如果连接数接近(注意是接近,不会达到的,因为不是所有进程都用来创建连接了)这个值,就会看到以上这些错误。 同时,在.NET端也会相应地看到错误日志: an existing connection was forcibly closed by the remote host mongodb 另外会伴有错误日志 Unable to read data from the transport connection: A