东京内阁 - 达到 100 万后插入速度变慢
我正在评估东京内阁表引擎。 在达到 100 万条记录后,插入速度明显减慢。 批量大小为 100,000,并且在事务内完成。 我尝试设置 xmsiz 但仍然没有用。 东京内阁有人遇到过这个问题吗?
详细信息
东京内阁 - 1.4.3
Perl 绑定 - 1.23
操作系统:Ubuntu 7.10(Windows XP 之上的 VMWare Player)
I am evaluating tokyo cabinet Table engine. The insert rate slows down considerable after hitting 1 million records. Batch size is 100,000 and is done within transaction. I tried setting the xmsiz but still no use. Has any one faced this problem with tokyo cabinet?
Details
Tokyo cabinet - 1.4.3
Perl bindings - 1.23
OS : Ubuntu 7.10 (VMWare Player on top of Windows XP)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我也遇到了每个分片大约 100 万条记录的问题(在客户端进行分片,没什么特别的)。 我尝试了各种 ttserver 选项,它们似乎没有什么区别,所以我查看了内核端,发现
回声80> /proc/sys/vm/dirty_ratio
(之前的值为 10)给出了很大的改进 - 以下是每分钟打印的数据的总大小(在 8 个分片上,每个分片在其自己的节点上):
所以您可以看到改进是按顺序进行的7-8次。 此时,每个节点的数据库大小约为 4.5GB(包括索引),并且节点具有 8GB RAM(因此 dirty_ratio 为 10 意味着内核尝试保留少于约 800MB 的脏数据)。
接下来我要尝试的是 ext2(当前:ext3)和 noatime,并将所有内容保存在 ramdisk 上(这可能会浪费两倍的内存,但可能是值得的)。
I hit a brick wall around 1 million records per shard as well (sharding on the client side, nothing fancy). I tried various ttserver options and they seemed to make no difference, so I looked at the kernel side and found that
echo 80 > /proc/sys/vm/dirty_ratio
(previous value was 10) gave a big improvement - the following is the total size of the data (on 8 shards, each on its own node) printed every minute:
So you can see that the improvement was in the order of 7-8 times. Database size was around 4.5GB per node at that point (including indexes) and the nodes have 8GB RAM (so dirty_ratio of 10 meant that the kernel tried to keep less than ca. 800MB dirty).
Next thing I'll try is ext2 (currently: ext3) and noatime and also keeping everything on a ramdisk (that would probably waste twice the amount of memory, but might be worth it).
我刚刚设置了缓存选项,现在速度明显加快了。
I just set the cache option and it is now significantly faster.
我认为修改dbtune函数中的bnum参数也会带来显着的速度提升。
I think modifying the bnum parameter in the dbtune function will also give a significant speed improvement.