Open keithmork opened 6 years ago
I agree with you. it seems the response time shown by mysql-tpcc is uncorrect. There is no problems with previous versions.
It has nothing to do with respone time calculation, value used here are indeed in milliseconds. At least in this version, the code has hardcoded slow transaction threshold values listed below, in milliseconds -
// main.c
#define RTIME_NEWORD 5 // new order
#define RTIME_PAYMENT 5 // payment
#define RTIME_ORDSTAT 5 // order status
#define RTIME_DELIVERY 80 // delivery
#define RTIME_SLEV 20 // stock level
You'll need to tune your DB config / storage type / connection count to see if you can reach a all "good" status.
The easier way might be using the tpcc command line options to set these threshold values to whever you want, as an example -
./tpcc_start -h127.0.0.1 -P3306 -dtpcc1000 -w10 -c1 -r10 -l120 -0 10 -1 10 -2 10 -3 70 -4 30
The numbers of last 5 options are corresponding to the order number of above macro defines, starting from 0.
How to fix this bug?
What about add divided by 1000?
rt = (double)()(tbuf2.tv_sec * 1000.0 + tbuf2.tv_nsec/1000000.0-tbuf1.tv_sec * 1000.0 - tbuf1.tv_nsec/1000000.0)/1000.0);
The response time seems to be milliseconds instead of seconds.
We can see the reported time is WAY bigger than the report interval:
And even bigger than the total run time:
And my db has
long_query_time = 0.1
yet there's nothing in the slow log.If it's indeed milliseconds, then the final reports and checks are incorrect.
Here seems to be the problem?
Similar issues:
https://github.com/Percona-Lab/tpcc-mysql/issues/6, 2016-10
tpcc-mysql 基准压测问题, 2017-09