-
Type: Question
-
Resolution: Done
-
Priority: Minor - P4
-
None
-
Affects Version/s: 1.8.1
-
Component/s: Networking
-
Environment:linux macos
If I connect to mongodb quickly in very short time. Mongodb server will soon be un-responsable and pymongo driver will raise an exception
even I tried sleep 1 sec, After about 200 connections mongo server begin to refuse connections
I have a production server splited in several processes when they connect to mongodb at the same time the problem will show up
reproduce the problem use the code below
macbook pro
from pymongo.errors import OperationFailure, AutoReconnect
from pymongo import Connection
import time
l = []
for i in xrange(5000):
conn = Connection('localhost',45678)
#time.sleep(1)#remove comment will make to 200 conns
l.append(conn)
time.sleep(300)