简体   繁体   English

TokyoCabinet写入速度太慢

[英]TokyoCabinet Write speed too slow

I have a perl script (in Ubuntu 12.04 LTS) writing to 26 TCH files. 我有一个Perl脚本(在Ubuntu 12.04 LTS中)写入26个TCH文件。 The keys are roughly equally distributed. 密钥大致平均分布。 The writes become very slow after 3 Million inserts (equally distributed to all the files) and the speed comes down from 240,000 inserts/min at the beginning to 14,000 inserts/min after 3 MM inserts . 写操作后成为300万个插入(平均分配到所有文件)很慢, 之后3 MM刀片的速度来自24个万辆插入/分钟下降开头 14000个插入/分钟 Individually the shard files are no more than 150 MB and overall their size comes to around 2.7 GB. 单独的分片文件最大不超过150 MB,总大小约为2.7 GB。

I run optimize on every TCH File after every 100K inserts to that file with bnum as 4*num_records_then and options set to TLARGE and make sure xmsiz matches the size of bnum (as mentioned in Why does tokyo tyrant slow down exponentially even after adjusting bnum? ) 每100K插入 bnum为4 * num_records_then且文件设置为TLARGE的文件后,我在每个TCH文件上运行优化 ,并确保xmsiz匹配bnum的大小(如为何调整了bnum后,东京暴君会成倍地减慢速度?

Even after this, the inserts start at high speed then slowly decrease to 14k inserts/min from 240k inserts/min. 即使在此之后,刀片也开始高速运转,然后从240k刀片/分钟缓慢降低到14k刀片/分钟。 Could it be due to holding multiple tch connections (26) in a single script? 可能是由于在一个脚本中保留了多个tch连接(26)? Or is there configuration setting, I'm missing (would disabling journaling help, but the above thread says journaling affects performance only after the tch file becomes bigger than 3-4GB, my shards are <150MB files..)? 还是缺少配置设置,我会丢失(是否要禁用日志记录帮助,但是上面的线程说日志记录仅在tch文件变得大于3-4GB,而我的碎片小于150MB时才影响性能。)?

I would turn off journaling and measure what changes. 我将关闭日记功能并评估发生了什么变化。 The cited thread talks about a 2-3 GB tch file, but if you sum the sizes of your 26 tch files, you are in the same league. 引用的线程讨论的是2-3 GB的tch文件,但是如果将26个tch文件的大小相加,则您处于同一联盟。 For the filesystem, the total amount of data ranges written to should be the relevant parameter. 对于文件系统,写入的数据范围总数应为相关参数。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM