mongodb 简单测试,同一个索引字段不同值查询,结果集越大,吞吐率越低.
我用mongodb 在开发机做了下简单测试 在同一索引字段create_id 不同值(1,2);1能查出9条数据(4314 bytes),2有一条数据满足(523 bytes).
使用 cluster 跑2个http子进程; 测试命令:siege http://127.0.0.1:3000 -c 1000 -t 1 测试结果如下: Transactions: 104830 hits Availability: 100.00 % Elapsed time: 59.16 secs Data transferred: 52.29 MB Response time: 0.06 secs Transaction rate: 1771.97 trans/sec Throughput: 0.88 MB/sec Concurrency: 108.17 Successful transactions: 104830 Failed transactions: 0 Longest transaction: 3.23 Shortest transaction: 0.00 结果集小的吞吐率: Transaction rate: 1771.97 trans/sec
Transactions: 36790 hits Availability: 100.00 % Elapsed time: 59.15 secs Data transferred: 151.36 MB Response time: 1.02 secs Transaction rate: 621.98 trans/sec Throughput: 2.56 MB/sec Concurrency: 635.06 Successful transactions: 36790 Failed transactions: 0 Longest transaction: 16.97 Shortest transaction: 0.02 结果集大的吞吐率: Transaction rate: 621.98 trans/sec
能说明,结果集越大,网络传输越慢,吞吐率越低???
望高手指点!!!