ITeye博客

写给高性能数据库引擎coolhash

xiaoZ5919 · 2014-05-27 16:54 · 企业架构 · Markdown

前一段时间fourinone在ITEYE资讯上发表了一篇http://www.iteye.com/news/29025-Fourinone-CoolHash高性能数据库引擎产品宣言,我回复评论说玩得酷,还要考得住,借用一些企鹅手机管家的台词,结果被fourinone十分不满意。又把我骂了一顿,我继续回击。面试的时候流行一句话,talk is cheap,show me the code,我在此又借用了一下,talk is cheap,show the benchmark!自此我每天一贴呼唤fourinone拿出benchmark,但至此他都没有回应!好吧我就自己动手看看CoolHash的高性能,我使用fourinone提到的4.05.06,进行了100并发100w请求的benchmark,并将代码放在https://git.oschina.net/zhh5919/fourinonetest不料在并发场景下CoolHash就会抛出异常,啊高性能啊! 详细过程如下: 搞这个东东,目的只有一个让我们看看fourinone coolhash的所谓高性能。 搞起来的步骤:

首先将项目导入eclipse中,会自动编译代码到bin目录,同时会将fourinone.jar copy到该 目录下,这个很重要,因为在fourinone提供的指南demo也是这么玩,尽量和他的demo一致, 要不fourinone会说你使用姿势不正确的。 启动CoolHashServer 从命令行cmd下进入bin目录。然后执行 java -cp fourinone.jar; RunServer 然后看到启动log Start ParkService and waiting 4 seconds... Start CoolHashService and waiting 5 seconds... Please try connect to CoolHashServer now. ok CoolHashServer启动成功啊 简单的benchmark,CoolHash只提供单线程的读写,而且仅仅是单线程写入几十个数据, 如果把他叫做benchmark,我想你看到这里,一定是呵呵 哈哈…… 那我们给他加点压力吧,100并发100w次请求,我想这不是什么难事儿吧!mongodb, ideawu开源的SSDB都能轻松做到,让我们来见识一下CoolHash看看行不行,我写了一段 模拟100并发100w请求的代码,在EasyCoolHashDemo,各位看官也可以帮我review一下。 执行看看吧! java -cp .;fourinone.jar EasyCoolHashDemo

执行结果让我差点崩溃了,哦不是我崩溃,是我的电脑崩溃了,cpu几乎100%。 我的电脑配置i5-3470 3.2GHz的,内存4G,win7系统。 惊喜的是哪有这些~ 根本执行不了,就不断地报错~ 欢迎更多的小伙伴来按上面的步骤 试试看看有木有报错! @fourinone啊 这就你所说的高性能,不是单线程写入几十个kv,然后每个kv都秒级别 就是高性能了

INFO: DataWorker Number:8 Exception in thread "Thread-9" java.lang.ArrayIndexOutOfBoundsException at java.lang.System.arraycopy(Native Method) at com.fourinone.FileAdapter$1.getBytes(FileAdapter.java:317) at com.fourinone.ConstantBit$Target$1.getBytes(ConstantBit.java:22) at com.fourinone.ConstantBit$Target.getTargetBytes(ConstantBit.java:175)

at com.fourinone.DumpCtor.put(DumpCtor.java:208)
at EasyCoolHashDemo$Worker.run(EasyCoolHashDemo.java:39)
at java.lang.Thread.run(Unknown Source)

Exception in thread "Thread-56" java.lang.ArrayIndexOutOfBoundsException at java.lang.System.arraycopy(Native Method) at com.fourinone.FileAdapter$1.getBytes(FileAdapter.java:317) at com.fourinone.ConstantBit$Target$1.getBytes(ConstantBit.java:22) at com.fourinone.ConstantBit$Target.getTargetBytes(ConstantBit.java:175)

at com.fourinone.DumpCtor.put(DumpCtor.java:208)
at EasyCoolHashDemo$Worker.run(EasyCoolHashDemo.java:39)
at java.lang.Thread.run(Unknown Source)

Exception in thread "Thread-81" java.lang.ArrayIndexOutOfBoundsException at java.lang.System.arraycopy(Native Method) at com.fourinone.FileAdapter$1.getBytes(FileAdapter.java:317) at com.fourinone.ConstantBit$Target$1.getBytes(ConstantBit.java:22) at com.fourinone.ConstantBit$Target.getTargetBytes(ConstantBit.java:175)

at com.fourinone.DumpCtor.put(DumpCtor.java:208)
at EasyCoolHashDemo$Worker.run(EasyCoolHashDemo.java:39)
at java.lang.Thread.run(Unknown Source)

Exception in thread "Thread-70" java.lang.ArrayIndexOutOfBoundsException at java.lang.System.arraycopy(Native Method) at com.fourinone.FileAdapter$1.getBytes(FileAdapter.java:317) at com.fourinone.ConstantBit$Target$1.getBytes(ConstantBit.java:22) at com.fourinone.ConstantBit$Target.getTargetBytes(ConstantBit.java:175)

at com.fourinone.DumpCtor.put(DumpCtor.java:208)
at EasyCoolHashDemo$Worker.run(EasyCoolHashDemo.java:39)
at java.lang.Thread.run(Unknown Source)

评论(4)

  1. #4 楼 · xiaoZ5919 · 2014-07-16 11:43

    cwqcwqmax9 writes:

    你的代码缺少运行文件 config.xml 你看coolhash的文档就知道 这个config.xml是自动生成的 如果你的没有生成那说明存在一些问题,我的测试环境是能自动生成的

  2. #3 楼 · cwqcwqmax9 · 2014-07-16 11:22

    你的代码缺少运行文件 config.xml

  3. #2 楼 · cwqcwqmax9 · 2014-07-16 11:22

    请把 config.xml 贴出来啊

    一运行RunServer 就会报错

    Start ParkService and waiting 4 seconds... Start CoolHashService and waiting 5 seconds... Please try connect to CoolHashServer now. java.io.FileNotFoundException: F:\高性能数据库引擎coolhash coolhash 测试\fourinonetest\config.xml (系统找不到指定的文件。)

    Exception in thread "Thread-9" java.lang.ExceptionInInitializerError at com.fourinone.BeanContext$1.run(BeanContext.java:332) Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 at java.util.ArrayList.rangeCheck(Unknown Source) at java.util.ArrayList.get(Unknown Source) at com.fourinone.ConfigContext.getLogLevel(ConfigContext.java:260) at com.fourinone.LogUtil.(LogUtil.java:13) ... 1 more

  4. #1 楼 · epanthere · 2014-07-10 15:26

    作者好像出了性能报告了~ http://www.iteye.com/news/29173-CoolHash-Database-Engine

评论功能维护中,当前仅展示历史评论。