php mongoclient使用,PHP: MongoClient::__construct - Manual

FOLLOW UP to comment on speed

Now using --

mongo 3.0.1 pre-compiled binaries

using mongo/php-1.6.6. driver from PECL

on php 5.6.0

on apache 2.4

on debian wheezy 7.8

Dropped in mongo 301 binaries

everything else unchanged

restarted apache

instantly started getting "No candidate servers found"

upgraded to mongo/php-1.6.6 driver on pecl

same result

of these four parms to \MongoClient()

A) 'mongodb:///tmp/mongodb-27017.sock'

B) #'mongodb://127.0.0.1:27017'

C) #'mongodb://localhost:27017'

D) #'mongodb://pri.eastghost.com:27017'

A) used to be 100x to 200x faster than B), C) and maybe 400x faster than D), as explained in comment below, but initially (after mongo 3.0.1 drop-in) A) stopped dead.  Tried B, instantly began working.  Went back to A), kept working.  Almost seems as if driver 1.6.6 can not populate candidate servers list when called via unix socket (/tmp/mongodb-27017.sock), but once the list is populated, calling via unix socket magically works fine.

While screwing around with this, all else unchanged, we're now noticing B) and C) seem to be as fast as A), and D) is only slightly slower (due to connect over WAN, instead of local LAN).  This behavior is as it theoretically should be: Maybe the once huge difference in the mongo php driver between unix sockets and localhost has been fixed?  Still testing -- will report back if any slowdown noticed.

see https://groups.google.com/forum/#!topic/mongodb-user/RTBDDMwywzA

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值