Cczzzz edited a comment on issue #3315:
URL: https://github.com/apache/rocketmq/issues/3315#issuecomment-914124366
I add Metrics and recompile。write page cache is quickly。the part of raft
sync is bottleneck。
specifically is :
long now = this.defaultMessageStore.getSystemClock().now();
return dledgerFuture.thenApply(appendEntryResponse -> {
metrics.putRtRAFT(this.defaultMessageStore.getSystemClock().now() - now);//my
Metrics
PutMessageStatus putMessageStatus =
PutMessageStatus.UNKNOWN_ERROR;
switch
(DLedgerResponseCode.valueOf(appendEntryResponse.getCode())) {
case SUCCESS:
putMessageStatus = PutMessageStatus.PUT_OK;
break;
case INCONSISTENT_LEADER:
case NOT_LEADER:
case LEADER_NOT_READY:
case DISK_FULL:
putMessageStatus =
PutMessageStatus.SERVICE_NOT_AVAILABLE;
break;
case WAIT_QUORUM_ACK_TIMEOUT:
//Do not return flush_slave_timeout to the client, for
the ons client will ignore it.
putMessageStatus = PutMessageStatus.OS_PAGECACHE_BUSY;
break;
case LEADER_PENDING_FULL:
putMessageStatus = PutMessageStatus.OS_PAGECACHE_BUSY;
break;
}
PutMessageResult putMessageResult = new
PutMessageResult(putMessageStatus, appendResult);
if (putMessageStatus == PutMessageStatus.PUT_OK) {
// Statistics
storeStatsService.getSinglePutMessageTopicTimesTotal(finalTopic).incrementAndGet();
storeStatsService.getSinglePutMessageTopicSizeTotal(msg.getTopic()).addAndGet(appendResult.getWroteBytes());
}
return putMessageResult;
});
wait dledgerFuture complete。I looked at the code inside ,all actions is
asynch,and use completableFuture。
this metrics result:
count = 30686435
min = 0
max = 4
mean = 1.40
stddev = 0.64
median = 1.00
75% <= 2.00
95% <= 2.00
98% <= 2.00
99% <= 2.00
99.9% <= 4.00
4.9.1、 jdk 11 、zgc.、and tps 1.8w ,msgsize 1k. and also execute os.sh.
producer avg ms 1.7ms,remove the network delay of 0.3ms. so raft is
bottleneck
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]