PHP Mongo Extention

97 views
Skip to first unread message

Tomasz R.

unread,
Mar 12, 2010, 12:19:55 AM3/12/10
to mongodb-user
Hi,

I'm using php Mongo Extention, and I'm trying to test it a bit.

I've setup a simple test script, that does a find and update on some
data I preloaded.
Everything goes well, till I hit about 25K of requests (concurrency of
10).
Then php starts throwing:

MongoConnectionException: : Cannot assign requested address in
<filepath> <linenumer>

Everything becomes extra slow, and does not recover until requests do
not stop. Any idea what's going on ?

Thanks

Kristina Chodorow

unread,
Mar 12, 2010, 10:05:42 AM3/12/10
to mongod...@googlegroups.com
I think this error is caused by running out of ports > 1023, so it's trying to bind to one of the superuser ports.  

The driver should close a connection when the Mongo instance goes out of scope... is it possible that your program isn't allowing certain connections or cursors to go out of scope?  



--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com.
To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.


Tomasz R.

unread,
Mar 13, 2010, 10:56:33 PM3/13/10
to mongodb-user
Just in case, I've closed my Mongo object using close()
That did not help. I keep hitting the bottleneck at around 24k

Are there any configs in mongoDB/PHP Mongo Extention that I should
check before doing any sort of stress test ?

I'm holding only ~15 small documents in MongoDB so the database is
small.

Do you know of a way that would allow me to watch my free ports while
running stress test? I'm on linux...

Thanks.

> > mongodb-user...@googlegroups.com<mongodb-user%2Bunsubscribe@google groups.com>

Kristina Chodorow

unread,
Mar 15, 2010, 11:07:07 AM3/15/10
to mongod...@googlegroups.com
It's possible that you're running into a mutex bug that was in 1.0.4... could you try the latest code at http://github.com/mongodb/mongo-php-driver ?

"netstat -t" lets you see what ports are being used.



To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.

Tomasz R.

unread,
Mar 31, 2010, 3:18:47 PM3/31/10
to mongodb-user
Just FYI,

I've found the reason for my troubles. It looks like I was running
under high traffic, and my connections were not set to persist.

I switched to persistent connections

---------------
$connection = new Mongo('mongodb://localhost', array('persist' =>
'php'));
---------------

and that solved I my issues.

Thanks.

Reply all
Reply to author
Forward
0 new messages