mongodb - Tokumx VS mongodb 读取性能

标签 mongodb stress-testing tsung tokumx

我正在通过比较 Tokumx 和纯 Mongodb 进行读取性能压力测试。

tokumx 和 mongodb 都在同一台机器上运行。

硬件概述:

Model Name: Mac mini
Model Identifier: Macmini6,1
Processor Name: Intel Core i5
Processor Speed: 2.5 GHz
Number of Processors: 1
Total Number of Cores: 2
L2 Cache (per Core): 256 KB
L3 Cache: 3 MB
Memory: 10 GB

每个实例中只有一个集合。每个集合中有 100,000 个条目。

对于 tokumx,它是作为分区集合创建的。但是对于 mongodb 来说,它被创建为一个普通的集合:

db.createCollection("sample", {partitioned: true, primaryKey:  {field1:1, _id: 1}});

对于这两个实例,索引如下所示:

db.sample.ensureIndex({field1:1});
db.sample.ensureIndex({field2:1});
db.sample.ensureIndex({field3:1});
db.sample.ensureIndex({field4:1});
db.sample.ensureIndex({geo:"2d"});
db.sample.ensureIndex({"created_at":1});

我正在使用 Tsung做压力测试。 在测试计划中,我通过查看按 created_at desc 排序的 field2geo 字段进行了简单搜索。

<clients>
<client host="localhost" use_controller_vm="false" maxusers="8000"/>
</clients>
<servers>
<server host="jchimac.thenetcircle.lab" port="8080" type="tcp"/>
</servers>
<load duration="5" unit="minute">
<arrivalphase phase="1" duration="5" unit="minute">
<users interarrival="0.03" unit="second"/>
</arrivalphase>
</load>

根据官方文档,交易应该是TOKUMX™ BENCHMARK VS. MONGODB – HDD

enter image description here

但在我的测试中:

托库姆:

enter image description here

enter image description here

MongoDB:

enter image description here

enter image description here

我在这里想知道是否有人可以对此提供任何提示?我在整个测试过程中是否遗漏了什么?


更新:

我在 Linux(CentOS) 机器上做了另一轮测试:

CentOS release 6.5 (Final)
2.6.32-504.1.3.el6.x86_64 GNU/Linux
MemTotal:       24589896 kB
CPU: 12* (Intel(R) Xeon(R) CPU E5645  @ 2.40GHz)

示例数据如下:

{
  "_id": ObjectId("54867dc8ffbc15aa2bc3ee0e"),
  "_iid": 15,
  "_pid": 15,
  "uid": 102296,
  "nickname": "nickname_102296",
  "gender": 3,
  "image_id": 15,
  "created_at": 1418100168,
  "tag": 1,
  "geo": {
    "lat": 51.590449999999997033,
    "lon": 6.9671900000000004383
  }
}

每个集合有 1,000,000 个条目。

每个集合的索引(创建普通集合):

db.createCollection("coll", {primaryKey:  {_pid:1, _id: 1}});
db.tokumx_coll.ensureIndex({gender:1}); 
db.tokumx_coll.ensureIndex({uid:1}); 
db.tokumx_coll.ensureIndex({geo:"2d"}); 
db.tokumx_coll.ensureIndex({_pid:1}); 
db.tokumx_coll.ensureIndex({_iid:1}); 
db.tokumx_coll.ensureIndex({"created_at":1}); 

测试计划也很简单:

{'$query', {gender,3,geo, {'$geoWithin', {'$center', [[48.72761, 9.24596], 0.005]}}}, '$orderby',{'_pid',-1}} 

Tsung 压力测试每次测试运行 1 小时。并发为每秒1个请求。

  <load>
    <arrivalphase phase="1" duration="60" unit="minute">
      <users interarrival="1" unit="second"/>
    </arrivalphase>
  </load>

报告截图如下:

TOKUMX:

tokumx summary
tokumx reports

MONGODB:

mongodb summary mongodb reports


更新@2014.12.12 发现这个: https://github.com/Tokutek/mongo/issues/1014

最佳答案

TokuMX 2.0.0 Community Edition for MongoDB 仍然建立在 MongoDB 2.4 之上,当我发表这篇文章时,它还没有 GEO 2dsphere 索引。所以如果你正在制作 Compound Indexes有GEO索引,你必须等待基于支持geo 2dshere索引的MongoDB 2.6版本。

基本上:

  • “2d indexes”:复合索引,只有一个附加字段,作为2d索引字段的后缀
  • “2dsphere indexes”:以标量索引字段(即升序或降序)作为 2dsphere 索引字段的前缀或后缀的复合索引

如果你对我的压力测试感兴趣,你可以在这个 post 中找到它.

关于mongodb - Tokumx VS mongodb 读取性能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27359394/

相关文章:

node.js - MongoDB 中的有条件应用和条件

javascript - 多个 node-mongodb-native 连接

MongoDB 数据集 : pairs not reducing or problem with script

jmeter - 性能测试 : JMeter vs Tsung

xml - 使用 tsung POST 请求发送 json

mongodb - Meteor MongoDB 查找/获取问题

android - 使用 Firebase 在服务器上对多个设备进行负载测试

spring - 了解 RESTful Web 服务压力测试结果

load - 如何为网站设置负载/压力测试?