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

ASF GitHub Bot commented on SCB-837:
------------------------------------

heyile commented on a change in pull request #947:  [SCB-837] make http2 
production ready
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/947#discussion_r224294134
 
 

 ##########
 File path: 
foundations/foundation-vertx/src/main/java/org/apache/servicecomb/foundation/vertx/metrics/DefaultHttpClientMetrics.java
 ##########
 @@ -133,7 +144,18 @@ public void disconnected(Object webSocketMetric) {
 
   @Override
   public DefaultHttpSocketMetric connected(SocketAddress remoteAddress, String 
remoteName) {
-    return new DefaultHttpSocketMetric(null);
+
+    DefaultHttpSocketMetric socketMetric = new DefaultHttpSocketMetric(null);
+    try {
+      DefaultHttpClientMetrics clientMetrics = (DefaultHttpClientMetrics) 
((HttpClientImpl) client).getMetrics();
+      DefaultClientEndpointMetric clientEndpointMetric = 
clientMetrics.clientEndpointMetricManager
+          .getClientEndpointMetricMap().get(remoteAddress);
+      // set endPointMetric when use http2
+      socketMetric.setEndpointMetric(clientEndpointMetric);
+    } catch (Exception e) {
+      LOGGER.warn("if you use http2, there may cause a null pointer exception. 
{}/{}", remoteAddress, remoteName);
 
 Review comment:
   because I have cast client to DefaultHttpClientMetrics  and invoke the  
method getMetrics().  I'm afraid that the method getMetrics() may return null, 
so I just catch it for safety.   But now, it seems impossible, I will change it

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> make http2 production ready
> ---------------------------
>
>                 Key: SCB-837
>                 URL: https://issues.apache.org/jira/browse/SCB-837
>             Project: Apache ServiceComb
>          Issue Type: Improvement
>          Components: Java-Chassis
>            Reporter: wujimin
>            Assignee: 何一乐
>            Priority: Major
>             Fix For: java-chassis-1.1.0
>
>
> currenty, http2 client use all http1.1 settings, that cause http2 client 
> performance is so bad.
>  
> we need to conside http2 client settings at least:
> 1.concurrent stream in one connection, default value is 3, we must make it 
> bigger
> 2.maxPoolSize, http1.1 need a big pool, but http2 need a big concurrent 
> stream count
>  
> we must perform a performance test, that make sure got a good result, and 
> then set the setting to be our default setting.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to