MongoDB "Connect failed. Operation now in progress"
yesterday appeared a strange behaviour:
on small load all queries take long time and then site return error "Connection to MongoDB failed. Operation now in progress" At mongostat we see about 10-30 connections (very small, because we usualy work with 400-500) But when I type "netstat -na | grep 27017" I see very big number of TCP connections (> 150):
http://pastebin.com/3ghtwkVd
Why mongodb closes connection but TCP still open?
We doesn't use persistent connections and always doing Mongo:close() at the end of scripts.
Site work on cloud system like Amazon EC2 (we doesn't observe any network issues)
10.1.1.16 - MongoDB 10.1.1.7 - Apache 1Gbit/s between servers OS: Debian 6开发者_开发百科 Squeeze MongoDB: 1.8.2 (with 1.6.6 we have the same problem) Apache 2 PHP 5.3.6 PHP mongo driver 1.1.0 (connection pooling in 1.2.x is very bad for us)
Looks like your driver (e.g. PHP) does not actually close the TCP connection even when you close it using the method.
If you're using PHP as a module, try graceful apache reload to make PHP module unloaded and loaded again. This way, destructors are called and connections are closed.
If you use PHP as fastcgi app, restart (kill/exec) it and invoke again.
File a bug if necessary.
精彩评论