目前cockroachdb没有专门的TPC-C测试工具,开发人员正在开发过程中:
@louishust there’s a work-in-progress program here: http://github.com/cockroachdb/loadgen - however there are several strong caveats that you should know about. it doesn’t implement think-time or wait-time yet, nor does it cap the number of workers per warehouse, so it’s not really quite tpc-c. you can think of it as “tpcc at maximum concurrency”, or a benchmark that stresses contention more than scalability.
If you’re really looking to check how CockroachDB performs on tpc-c as the world understands it, you’ll need to wait a little bit until we finish up the work of making the benchmark accurate
we’re actively working on improving the benchmark so it shouldn’t be too long - maybe a week or two
cockroachdb走的是pg协议,故可以尝试使用benchmarksql进行TPC-C测试。
由于cockroachdb不完全兼容pg,故可以通过如下方法进行数据初始化:
- 通过PG生成数据
pg_dump
导出数据为COPY语句- cockroachdb导入COPY语句
测试过程有些语句不兼容,比如select for update
。虽然cockroachdb不支持这个语句,
但是cockroachdb的SSI隔离级别可以达到同等效果,故只需要去掉测试中的for update
语句即可。