I am running into a weird error when trying connect to mongodb. I am running this mongo server on amazon. I have multiple processes accessing the same database and thats when I get the error. It doesn’t happen when I run a single process accessing the db. Anyways, this is the error:
PHP Fatal error: Uncaught exception ‘MongoConnectionException’ with
message ‘connecting to
mongodb://(username):(password)@(server):(port)/(db) failed: Cannot
assign requested address’ in /var/www/html/dev/folder/process.php:151
and on line 51:
$m = new Mongo('mongodb://(username):(password)@(server):(port)/(db)');
any ideas of what this means?
That error can occur if the server system runs out of ports. That can be caused from a bug in mongodb (1.0.4) or just by the pure number of connections.
Reduce connections and/or switching to persistent connections might help as well.
Source