You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by xiaohu-zhang <gi...@git.apache.org> on 2018/07/10 04:59:23 UTC

[GitHub] httpcomponents-core pull request #68: HTTPCORE-532

GitHub user xiaohu-zhang opened a pull request:

    https://github.com/apache/httpcomponents-core/pull/68

    HTTPCORE-532

    IOReactor thread can be lazy started

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/xiaohu-zhang/httpcomponents-core lazyinitIOReactor

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/httpcomponents-core/pull/68.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #68
    
----
commit 2d8905069831b542013ac2cd042d857c87615125
Author: xiaohu-zhang <si...@...>
Date:   2018-07-10T04:53:11Z

    HTTPCORE-532
    
    IOReactor thread can be lazy started

----


---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[GitHub] httpcomponents-core issue #68: HTTPCORE-532

Posted by xiaohu-zhang <gi...@git.apache.org>.
Github user xiaohu-zhang commented on the issue:

    https://github.com/apache/httpcomponents-core/pull/68
  
    what if can not anticipate ?lazy init is little useful in  performance。Also the code can be modified do not use instanceof .after all , it depends on you.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[GitHub] httpcomponents-core pull request #68: HTTPCORE-532

Posted by ok2c <gi...@git.apache.org>.
Github user ok2c commented on a diff in the pull request:

    https://github.com/apache/httpcomponents-core/pull/68#discussion_r201268536
  
    --- Diff: httpcore5/src/main/java/org/apache/hc/core5/http/impl/bootstrap/AsyncServer.java ---
    @@ -73,8 +73,12 @@ public AsyncServer(
         }
     
         @Override
    -    public void start() {
    -        ioReactor.start();
    +    public void start(final int i) {
    +        throw new RuntimeException("can not call start(i) method with AsyncServer class,maybe call serverStart method?");
    --- End diff --
    
    @xiaohu-zhang I cannot commit changes like that.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[GitHub] httpcomponents-core issue #68: HTTPCORE-532

Posted by xiaohu-zhang <gi...@git.apache.org>.
Github user xiaohu-zhang commented on the issue:

    https://github.com/apache/httpcomponents-core/pull/68
  
    when use few connections,for example ,use always one connection in connection pool each time(), or no http connection used when project started.framework can use less thread ,that will reduce the thread number and load in computer.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[GitHub] httpcomponents-core issue #68: HTTPCORE-532

Posted by xiaohu-zhang <gi...@git.apache.org>.
Github user xiaohu-zhang commented on the issue:

    https://github.com/apache/httpcomponents-core/pull/68
  
    there is somthing wrong with the code ,let me correct it first


---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[GitHub] httpcomponents-core issue #68: HTTPCORE-532

Posted by xiaohu-zhang <gi...@git.apache.org>.
Github user xiaohu-zhang commented on the issue:

    https://github.com/apache/httpcomponents-core/pull/68
  
    yes.it has a little useful only when connections less than worker thread,and is not anticipate by user before.
    just tiny improvement.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[GitHub] httpcomponents-core issue #68: HTTPCORE-532

Posted by ok2c <gi...@git.apache.org>.
Github user ok2c commented on the issue:

    https://github.com/apache/httpcomponents-core/pull/68
  
    @xiaohu-zhang If you anticipate few connections and want fewer threads you really _should_ configure fewer workers. Overall, I think this change-set causes more problems than it solves.  


---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[GitHub] httpcomponents-core issue #68: HTTPCORE-532

Posted by ok2c <gi...@git.apache.org>.
Github user ok2c commented on the issue:

    https://github.com/apache/httpcomponents-core/pull/68
  
    @xiaohu-zhang Why? The I/O reactor distributes sessions across all available workers equally. If you have n worker threads, all of them will get started after n connections.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[GitHub] httpcomponents-core pull request #68: HTTPCORE-532

Posted by ok2c <gi...@git.apache.org>.
Github user ok2c commented on a diff in the pull request:

    https://github.com/apache/httpcomponents-core/pull/68#discussion_r201268240
  
    --- Diff: httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/IOReactorExecutor.java ---
    @@ -85,7 +85,10 @@ public void execute(final IOSession session) {
     
                     }))) {
                 if (status.compareAndSet(Status.READY, Status.RUNNING)) {
    -                ioReactorRef.get().start();
    +                if(this instanceof AsyncServer){
    --- End diff --
    
    @xiaohu-zhang This is terrible. Even for test classes we should not be doing things like that.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[GitHub] httpcomponents-core issue #68: HTTPCORE-532

Posted by ok2c <gi...@git.apache.org>.
Github user ok2c commented on the issue:

    https://github.com/apache/httpcomponents-core/pull/68
  
    @xiaohu-zhang Please close this PR.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[GitHub] httpcomponents-core pull request #68: HTTPCORE-532

Posted by xiaohu-zhang <gi...@git.apache.org>.
Github user xiaohu-zhang closed the pull request at:

    https://github.com/apache/httpcomponents-core/pull/68


---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org