fengshao0907 / treapdb

Automatically exported from code.google.com/p/treapdb
0 stars 0 forks source link

关于性能 #6

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
我在网上找的一个对抗测试(by TimYang大牛):

http://timyang.net/data/mcdb-tt-redis/

我拿TreapDB跑了一下:
小数据:写42517每秒,读:39098每秒
大数据:写4599每秒:读:3838每秒

我这里的key是顺序产生的,不知道Tim的key是乱序的还是顺序的�
��

测试代码(写):

{{{
from thrift import Thrift
from thrift.transport import TTransport
from thrift.transport import TSocket
from thrift.protocol.TBinaryProtocol import TBinaryProtocolAccelerated
from pytreap import TreapDBService
from pytreap.ttypes import *
import string
import time
import random

def main():
    socket = TSocket.TSocket("localhost", 11812)
    transport = TTransport.TBufferedTransport(socket)
    protocol = TBinaryProtocol.TBinaryProtocolAccelerated(transport)
    client = TreapDBService.Client(protocol)
    transport.open()
    data = 'x'*100
    count = 5000000 
    t1 = time.time()
    buffer = {}
    for i in xrange(count):
        buffer[str(i)] = data
        if i%3000 == 0:
            client.bulkPut(buffer)
            buffer = {}
        if i% 100 == 0:
            print i
    transport.close()
    t2 = time.time()
    print (count+0.0)/(t2-t1)

if __name__ == "__main__":
    main()

}}}

Original issue reported on code.google.com by ccnu...@gmail.com on 14 Dec 2010 at 9:27

GoogleCodeExporter commented 8 years ago
Tim的测试每个key的区分度很大,都是数字。所以按照个测试��
�结果比我原先的benchmark高出好多(我原先的bechmark中都带"thing"
这个前缀,而且数字的范围更广),真是令人高兴。性能至少�
��MemcacheDB(注意,不是memcached)要好。

Original comment by ccnu...@gmail.com on 14 Dec 2010 at 9:38

GoogleCodeExporter commented 8 years ago
configuration in this benchmark:

<?xml version="1.0" encoding="UTF-8"?>
<TreapDB>
        <Params>
                <Port>
                        <Memcache>11811</Memcache>
                        <Thrift>11812</Thrift>
                </Port>
                <Index>
                        <FilePath>/var/log/treapdb/master</FilePath>
                        <BlockSize>64</BlockSize>
                </Index>
                <MMapSize>320</MMapSize>
                <Replication>
                        <Role>Master</Role>
                </Replication>
        </Params>
</TreapDB>

Original comment by ccnu...@gmail.com on 20 Dec 2010 at 3:31

GoogleCodeExporter commented 8 years ago
大小数据分别是多少k?

Original comment by kimmking...@gmail.com on 24 Dec 2010 at 4:04

GoogleCodeExporter commented 8 years ago
小数据100 bytes , 大数据20k bytes。
测试程序在上面给出来了,key是顺序产生的,使用了批量插��
�。
内存映射分配为320M(如上述配置文件)

Original comment by ccnu...@gmail.com on 25 Dec 2010 at 12:59