Github user lizhanhui commented on a diff in the pull request:
https://github.com/apache/incubator-rocketmq/pull/61#discussion_r101704927
--- Diff: common/src/main/java/org/apache/rocketmq/common/BrokerConfig.java
---
@@ -47,6 +47,7 @@
private boolean autoCreateSubscriptionGroup = true;
private String messageStorePlugIn = "";
+ //thread counts for sending message, if large number threads are
needed, we suggest setting useReentrantLockWhenPutMessage=true(in
MessageStoreConfig)
--- End diff --
IMO, this is the tradeoff between two kinds of synchronization
implementations: busy-waiting and mutex-lock; The former approach indeed wastes
more CPU cycles which may be utilized to finish other tasks by scheduler, but
it has its benefits too--doing so actually prioritize current data flow; Even
if the latter is energy-saving, it has its cons, say, more latencies are
introduced.
Another factor is the operation system being used. OS is getting so smart
that things may have changed considerably.
If someone may provide raw data, comparing effects of these two choices
under various conditions(# of cpu cores, # of send-message-threads,
flush-disk-type, etc), it would be very informative and valuable.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---