Why is PyMongo 3 giving ServerSelectionTimeoutError?
问题 I'm using: Python 3.4.2 PyMongo 3.0.2 mongolab running mongod 2.6.9 uWSGI 2.0.10 CherryPy 3.7.0 nginx 1.6.2 uWSGI start params: --socket 127.0.0.1:8081 --daemonize --enable-threads --threads 2 --processes 2 I setup my MongoClient ONE time: self.mongo_client = MongoClient('mongodb://user:pw@host.mongolab.com:port/mydb') self.db = self.mongo_client['mydb'] I try and save a JSON dict to MongoDB: result = self.db.jobs.insert_one(job_dict) It works via a unit test that executes the same code path