[ 
https://issues.apache.org/jira/browse/ROCKETMQ-253?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16119380#comment-16119380
 ] 

ASF GitHub Bot commented on ROCKETMQ-253:
-----------------------------------------

Github user shroman commented on a diff in the pull request:

    https://github.com/apache/incubator-rocketmq/pull/140#discussion_r132086276
  
    --- Diff: 
broker/src/main/java/org/apache/rocketmq/broker/out/BrokerOuterAPI.java ---
    @@ -148,12 +148,13 @@ private RegisterBrokerResult registerBroker(
             requestHeader.setBrokerName(brokerName);
             requestHeader.setClusterName(clusterName);
             requestHeader.setHaServerAddr(haServerAddr);
    +        requestHeader.setCompressed(true);
             RemotingCommand request = 
RemotingCommand.createRequestCommand(RequestCode.REGISTER_BROKER, 
requestHeader);
     
             RegisterBrokerBody requestBody = new RegisterBrokerBody();
             requestBody.setTopicConfigSerializeWrapper(topicConfigWrapper);
             requestBody.setFilterServerList(filterServerList);
    -        request.setBody(requestBody.encode());
    +        request.setBody(requestBody.encode(true));
    --- End diff --
    
    Great idea!
    How about setting a threshold for compression being triggered, because if 
the data you compress is small, it overhead is higher than the benefits you get 
from the compression?


> Compress RegisterBrokerBody
> ---------------------------
>
>                 Key: ROCKETMQ-253
>                 URL: https://issues.apache.org/jira/browse/ROCKETMQ-253
>             Project: Apache RocketMQ
>          Issue Type: Improvement
>          Components: rocketmq-broker, rocketmq-commons, rocketmq-namesrv
>            Reporter: Zhanhui Li
>            Assignee: yukon
>
> RocketMQ Brokers periodically register itself against namesrv to maintain its 
> liveness.
> In case a broker has many topics, a 10 thousand or more, two major 
> problematic issues show up:
> 1) Current serialization of RegisterBrokerBody would create a large String 
> object, which stresses GC  a lot, especially when G1 is used.
> 2) Transmission this bulk of data takes up significant portion of bandwidth.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to