Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(feat) add flush consolidation handler #161

Merged
merged 4 commits into from
Jun 17, 2019
Merged

Conversation

fengjiachun
Copy link

Flush operations are generally speaking expensive as these may trigger a syscall on the transport level.
Thus it is in most cases a good idea to try to minimize flush operations as much as possible.

@fengjiachun
Copy link
Author

TODO benchmark

@fengjiachun
Copy link
Author

 * body=4096, CODEC_FLUSH_CONSOLIDATION=turnOff
 * Request count: 10240000, time: 347 second, qps: 29510
 *
 * body=4096, CODEC_FLUSH_CONSOLIDATION=turnOn
 * Request count: 10240000, time: 311 second, qps: 32926
 *
 * -------------------------------------------------------
 *
 * body=1024, CODEC_FLUSH_CONSOLIDATION=turnOff
 * Request count: 10240000, time: 206 second, qps: 49708
 *
 * body=1024, CODEC_FLUSH_CONSOLIDATION=turnOn
 * Request count: 10240000, time: 148 second, qps: 69189
 *
 * -------------------------------------------------------
 *
 * body=128, CODEC_FLUSH_CONSOLIDATION=turnOff
 * Request count: 10240000, time: 148 second, qps: 69189
 *
 * body=128, CODEC_FLUSH_CONSOLIDATION=turnOn
 * Request count: 10240000, time: 69 second, qps: 148405
 *

@fengjiachun
Copy link
Author

     * CODEC_FLUSH_CONSOLIDATION=turnOn
     * Benchmark                     Mode  Cnt   Score    Error   Units
     * JMHBenchmarkClient.send1024  thrpt    3  51.310 ± 11.585  ops/ms
     * JMHBenchmarkClient.send128   thrpt    3  68.493 ± 20.078  ops/ms
     *
     * CODEC_FLUSH_CONSOLIDATION=turnOff
     * Benchmark                     Mode  Cnt   Score    Error   Units
     * JMHBenchmarkClient.send1024  thrpt    3  37.769 ± 31.279  ops/ms
     * JMHBenchmarkClient.send128   thrpt    3  44.074 ± 32.570  ops/ms

@fengjiachun
Copy link
Author

     * CODEC_FLUSH_CONSOLIDATION=turnOn
     * Benchmark                                       Mode      Cnt   Score    Error   Units
     * JMHBenchmarkClient.send1024                    thrpt        3  46.887 ± 22.766  ops/ms
     * JMHBenchmarkClient.send128                     thrpt        3  66.376 ± 28.429  ops/ms
     * JMHBenchmarkClient.send1024                     avgt        3   0.674 ±  0.986   ms/op
     * JMHBenchmarkClient.send128                      avgt        3   0.479 ±  0.239   ms/op
     * JMHBenchmarkClient.send1024                   sample  1525751   0.629 ±  0.001   ms/op
     * JMHBenchmarkClient.send1024:send1024·p0.00    sample            0.150            ms/op
     * JMHBenchmarkClient.send1024:send1024·p0.50    sample            0.602            ms/op
     * JMHBenchmarkClient.send1024:send1024·p0.90    sample            0.775            ms/op
     * JMHBenchmarkClient.send1024:send1024·p0.95    sample            0.854            ms/op
     * JMHBenchmarkClient.send1024:send1024·p0.99    sample            1.614            ms/op
     * JMHBenchmarkClient.send1024:send1024·p0.999   sample            2.249            ms/op
     * JMHBenchmarkClient.send1024:send1024·p0.9999  sample            4.280            ms/op
     * JMHBenchmarkClient.send1024:send1024·p1.00    sample            6.431            ms/op
     * JMHBenchmarkClient.send128                    sample  1913189   0.501 ±  0.001   ms/op
     * JMHBenchmarkClient.send128:send128·p0.00      sample            0.150            ms/op
     * JMHBenchmarkClient.send128:send128·p0.50      sample            0.481            ms/op
     * JMHBenchmarkClient.send128:send128·p0.90      sample            0.618            ms/op
     * JMHBenchmarkClient.send128:send128·p0.95      sample            0.688            ms/op
     * JMHBenchmarkClient.send128:send128·p0.99      sample            1.190            ms/op
     * JMHBenchmarkClient.send128:send128·p0.999     sample            2.097            ms/op
     * JMHBenchmarkClient.send128:send128·p0.9999    sample            4.391            ms/op
     * JMHBenchmarkClient.send128:send128·p1.00      sample            7.053            ms/op
     * JMHBenchmarkClient.send1024                       ss        3   5.179 ± 18.142   ms/op
     * JMHBenchmarkClient.send128                        ss        3   3.788 ± 10.388   ms/op
     *
     * CODEC_FLUSH_CONSOLIDATION=turnOff
     * Benchmark                                       Mode      Cnt   Score    Error   Units
     * JMHBenchmarkClient.send1024                    thrpt        3  35.946 ± 10.332  ops/ms
     * JMHBenchmarkClient.send128                     thrpt        3  41.364 ± 36.002  ops/ms
     * JMHBenchmarkClient.send1024                     avgt        3   0.846 ±  0.272   ms/op
     * JMHBenchmarkClient.send128                      avgt        3   0.731 ±  0.306   ms/op
     * JMHBenchmarkClient.send1024                   sample  1003714   0.956 ±  0.001   ms/op
     * JMHBenchmarkClient.send1024:send1024·p0.00    sample            0.183            ms/op
     * JMHBenchmarkClient.send1024:send1024·p0.50    sample            0.886            ms/op
     * JMHBenchmarkClient.send1024:send1024·p0.90    sample            1.294            ms/op
     * JMHBenchmarkClient.send1024:send1024·p0.95    sample            1.495            ms/op
     * JMHBenchmarkClient.send1024:send1024·p0.99    sample            2.241            ms/op
     * JMHBenchmarkClient.send1024:send1024·p0.999   sample            3.977            ms/op
     * JMHBenchmarkClient.send1024:send1024·p0.9999  sample            8.448            ms/op
     * JMHBenchmarkClient.send1024:send1024·p1.00    sample           21.660            ms/op
     * JMHBenchmarkClient.send128                    sample  1346879   0.712 ±  0.001   ms/op
     * JMHBenchmarkClient.send128:send128·p0.00      sample            0.124            ms/op
     * JMHBenchmarkClient.send128:send128·p0.50      sample            0.684            ms/op
     * JMHBenchmarkClient.send128:send128·p0.90      sample            0.927            ms/op
     * JMHBenchmarkClient.send128:send128·p0.95      sample            1.016            ms/op
     * JMHBenchmarkClient.send128:send128·p0.99      sample            1.571            ms/op
     * JMHBenchmarkClient.send128:send128·p0.999     sample            2.322            ms/op
     * JMHBenchmarkClient.send128:send128·p0.9999    sample            4.375            ms/op
     * JMHBenchmarkClient.send128:send128·p1.00      sample            5.865            ms/op
     * JMHBenchmarkClient.send1024                       ss        3   5.932 ± 13.160   ms/op
     * JMHBenchmarkClient.send128                        ss        3   5.028 ± 10.273   ms/op

@fengjiachun fengjiachun changed the base branch from master to dev_1.6.1 June 17, 2019 08:16
@dbl-x dbl-x merged commit d6b9d70 into sofastack:dev_1.6.1 Jun 17, 2019
@dbl-x dbl-x self-requested a review June 27, 2019 03:16
@dbl-x dbl-x added dev:feature New feature or request dev:tuning Some improvement labels Jun 27, 2019
@dbl-x dbl-x added this to the 1.6.1 release milestone Jun 27, 2019
dbl-x pushed a commit that referenced this pull request Dec 16, 2019
* (feat) add flush consolidation handler (#161)

* (feat) add flush consolidation option

* 1. upgrade version to 1.5.6 (#169)

2. fix NPE in channelInactive
3. handling reconnection situation with no connection binding with channel
4. du not scan connection pool associated with task that has not been don
5. add CONNECT_FAILED event type and print user event log

* Change org from alipay to sofatack. (#172)

* Update .travis.yml (#177)

* modify ReconnectManager to be compatible with version 1.5.x

* upgrade netty version to fix CNNVD-201909-1264 vulnerability (#189)

* 应该一个是序列化一个是反序列化 (#191)

fix unit test bug in class NormalStringCustomSerializer.

* (feat) Supports SSL for rpc server/client, #149 (#197)

* support server random port constructor. fix #196 (#199)

* fix AbstractLifeCycle concurrency problem Fixes gh-163 (#188)

* fix  AsynMultiInterestUserProcessor dispatch to sync handleRequest  method problem. gh-157

* Revert "fix  AsynMultiInterestUserProcessor dispatch to sync handleRequest  method problem. gh-157"

This reverts commit 2784f9e.

* support server random port constructor

* add rejection-processable InvokeCallback to provide flexible options when user executor rejected task. see #178(#178) (#202)

* complete tcp related config. see #171(#171) (#205)

* optimize DefaultConnectionManager contructor (#201)

* support availability check with life cycle. #195 (#204)

* support availability check with life cycle. #123(#123)

* complete unit test of life cycle available check

* fix CI error

* Fix/multi processor bug (#207)

* fix spell mistake and some test codes (#194)

* fix multi-processor bug

* fix PMD

* support user processor with life cycle interface fix #123 (#200)

* support user processor with life cycle interface

* make sure user processor startup if client/server has startup

* add state check before operate user processor in order to prevent from some unnecessary exception

* fix some codes (#208)

* change version
@fengjiachun fengjiachun mentioned this pull request Apr 17, 2020
12 tasks
@dbl-x dbl-x mentioned this pull request Jul 6, 2020
cytnju added a commit that referenced this pull request Jul 6, 2020
* release 1.6.1 (#209)

* (feat) add flush consolidation handler (#161)

* (feat) add flush consolidation option

* 1. upgrade version to 1.5.6 (#169)

2. fix NPE in channelInactive
3. handling reconnection situation with no connection binding with channel
4. du not scan connection pool associated with task that has not been don
5. add CONNECT_FAILED event type and print user event log

* Change org from alipay to sofatack. (#172)

* Update .travis.yml (#177)

* modify ReconnectManager to be compatible with version 1.5.x

* upgrade netty version to fix CNNVD-201909-1264 vulnerability (#189)

* 应该一个是序列化一个是反序列化 (#191)

fix unit test bug in class NormalStringCustomSerializer.

* (feat) Supports SSL for rpc server/client, #149 (#197)

* support server random port constructor. fix #196 (#199)

* fix AbstractLifeCycle concurrency problem Fixes gh-163 (#188)

* fix  AsynMultiInterestUserProcessor dispatch to sync handleRequest  method problem. gh-157

* Revert "fix  AsynMultiInterestUserProcessor dispatch to sync handleRequest  method problem. gh-157"

This reverts commit 2784f9e.

* support server random port constructor

* add rejection-processable InvokeCallback to provide flexible options when user executor rejected task. see #178(#178) (#202)

* complete tcp related config. see #171(#171) (#205)

* optimize DefaultConnectionManager contructor (#201)

* support availability check with life cycle. #195 (#204)

* support availability check with life cycle. #123(#123)

* complete unit test of life cycle available check

* fix CI error

* Fix/multi processor bug (#207)

* fix spell mistake and some test codes (#194)

* fix multi-processor bug

* fix PMD

* support user processor with life cycle interface fix #123 (#200)

* support user processor with life cycle interface

* make sure user processor startup if client/server has startup

* add state check before operate user processor in order to prevent from some unnecessary exception

* fix some codes (#208)

* change version

* update travis ci config

Co-authored-by: cytnju <muyun.cyt@antfin.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev:feature New feature or request dev:tuning Some improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants