版本比较

密钥

  • 该行被添加。
  • 该行被删除。
  • 格式已经改变。

...

基于https://github.com/starcoinorg/rust-rocksdb/tree/rocksdb_crc32_sse_make 这个分支测试加入fast_Crc32

针对固定转账可以提升3%性能

交易数压测 里面1435提升到1485

/wiki/spaces/WESTAR/pages/10190894 里面1435提升到1485

查看是否启用fast_crc32使用如下命令

代码块
nm -n starcoin | grep Fast_CRC32

有输出就是启用了

或者进入rocksdb目录比如~/.main/starcoindb/db/starcoindb查看如下信息

代码块
ubuntu@ip-192-168-15-110:/workspace/main.bak/starcoindb/db/starcoindb$ grep "CRC" LOG
2022/02/14-06:21:30.783632 7f094ff6c700 Fast CRC32 supported: Not supported on x86

2. write_buffer相关设定

write buffer number 5

...

set_max_background_jobs(5);

固定转账提升3%

创建账号提升1%

3. 打开统计

https://github.com/facebook/rocksdb/wiki/Statistics 提到会有5%-10%的性能损失

统计据说有一点性能损失,主要是为了跟踪每个columnfamily的一些指标数据

db_opts.enable_statistics();

打开后我测试中有一次segfault了,原因不明

4. set_row_cache

cache设置成这个

可能与lru cache冲突

// let cache = Cache::new_lru_cache(2 * 1024 * 1024 * 1024); // db_opts.set_row_cache(&cache.unwrap());

目前看起来写的性能下降了

对基于读的性能场景可能性能提升

...

5. compress

目前我们使用的压缩方式是

cf_opts.set_compression_type(rocksdb::DBCompressionType::Lz4);

...