[SERVER-331] Unexpected MongoConnectionException Created: 01/Oct/09  Updated: 17/Oct/09  Resolved: 02/Oct/09

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 1.0.1
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Ivan Petrov Assignee: Kristina Chodorow (Inactive)
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

centos 5.3, php 5.3


Attachments: File MyMongo.php     File mongoIdBag.php     Text File mongod-verbose.txt     File sockTest.php     Text File sockTest.php.log    
Participants:

 Description   

on 451 connect mongo say Exception

20:53: Fatal error: Uncaught exception 'MongoConnectionException' with message '127.0.0.1:3412' in /var/www/vhosts/pirates/script/MyMongo.php:16
Stack trace:
#0 /var/www/vhosts/pirates/script/MyMongo.php(16): Mongo->__construct('127.0.0.1:3412')
#1 /var/www/vhosts/pirates/script/MyMongo.php(23): Main_Service_Mongo->getConnection()
#2 /var/www/vhosts/pirates/script/mongoIdBag.php(62): Main_Service_Mongo->getCollection('test')
#3

{main}

thrown in /var/www/vhosts/pirates/script/MyMongo.php on line



 Comments   
Comment by Eliot Horowitz (Inactive) [ 02/Oct/09 ]

SERVER-332

Comment by Kristina Chodorow (Inactive) [ 02/Oct/09 ]

Which makes this... Eliot's problem! Moving to Core Server.

Comment by Ivan Petrov [ 02/Oct/09 ]

I think best way is make MongoDB used epoll for linux and kqueue for bsd

Comment by Ivan Petrov [ 02/Oct/09 ]

no design of application is contain prefork apache. MongoDB use now old noneffective methods of using sockets:
while ( 1 ) accept();
We can create new abstract level for getting connections from apache with epoll mechanism and forward it to mongod with persistent connect, but it not way of true Jedi.

Comment by Kristina Chodorow (Inactive) [ 02/Oct/09 ]

Can you use persistent connections? If you change line 17 of MyMongo.php to:

$this->connection = new Mongo(self::MONGO_CONNECTIONS, true, true);

it reuses connections, instead of opening new ones.

Comment by Ivan Petrov [ 02/Oct/09 ]

It is a problem of mongod service, It cant work without errors with more then 200-2000 connect()-s per second.

Im tested server with sockTest.php

Comment by Ivan Petrov [ 01/Oct/09 ]

Found that is not a problem of php driver, looks like a problem with OS call connect().

Generated at Thu Feb 08 02:53:45 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.