我有这个疑问MongoDB的Ubuntu的亚马逊网络服务
db.tablebusiness.find({ “LongitudeLatitude”:{ “内$”:{ “$ centerSphere”:[106.772835,-6.186753],0.0089967464101566 ]}},“indexContents”:{“$ all”:[“warung”]},“Prominent”:{“$ gte”:15}})。limit(50);
问题:在mongodb窗口中,这个查询运行得很快不到1秒,但在ubuntu服务器中amazon这个查询没有运行。花了1分钟。
当然,还有像亚马逊服务器(我的本地主机有8GB内存)内存较低的问题。但是,性能差异很大。
在我的本地服务器上,例如,我可以运行1000000个线程。亚马逊thingy只运行1或2个查询。
两者都被索引。事实上,亚马逊服务器是我的本地主机的确切副本。我只是将文件从localhost上传到亚马逊。
它们都被索引。事实上,最近我给亚马逊增加了额外的索引。
localhost的指标为:
{LongitudeLatitude :"2d",indexContents :1,Prominent:-1}
亚马逊的指标为:
{LongitudeLatitude :"2d",indexContents :1,Prominent:-1}
我们还添加
{LongitudeLatitude :"2d",Prominent:-1} latter to no effect
有谁知道什么是错在我的Ubuntu的服务器亚马逊?
dbserever在本地主机是
db.runCommand("buildInfo")
{
"version" : "2.0.7",
"gitVersion" : "875033920e8869d
"sysInfo" : "windows sys.getwin
platform=2, service_pack='Service Pack
"versionArray" : [
2,
0,
7,
0
],
"bits" : 64,
"debug" : false,
"maxBsonObjectSize" : 16777216,
"ok" : 1
dbserever在Ubuntu的亚马逊
db.runCommand("buildInfo");
{
"version" : "2.0.7",
"gitVersion" : "875033920e8869d284f32119413543fa475227bf",
"sysInfo" : "Linux ip-10-2-29-40 2.6.21.7-2.ec2.v1.2.fc8xen #1 SMP Fri Nov 20 17:48:28 EST 2009 x86_64 BOOST_LIB_VERSION=1_41",
"versionArray" : [
2,
0,
7,
0
],
"bits" : 64,
"debug" : false,
"maxBsonObjectSize" : 16777216,
"ok" : 1
}
检查答案http://stackoverflow.com/questions/12524175/why-all-in-mongodb-is-much-much,请告诉我,如果我错了。 –