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

update broker to speed up mqttproxy client connection #762

Merged
merged 1 commit into from
Aug 22, 2022

Conversation

suchen-sci
Copy link
Contributor

No description provided.

@codecov-commenter
Copy link

codecov-commenter commented Aug 22, 2022

Codecov Report

Base: 78.80% // Head: 78.78% // Decreases project coverage by -0.01% ⚠️

Coverage data is based on head (0ab8c58) compared to base (1877fbf).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #762      +/-   ##
==========================================
- Coverage   78.80%   78.78%   -0.02%     
==========================================
  Files         100      100              
  Lines       11118    11118              
==========================================
- Hits         8761     8759       -2     
- Misses       1854     1856       +2     
  Partials      503      503              
Impacted Files Coverage Δ
pkg/object/mqttproxy/broker.go 74.79% <100.00%> (ø)
pkg/filters/headerlookup/headerlookup.go 84.61% <0.00%> (-1.40%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@haoel
Copy link
Contributor

haoel commented Aug 22, 2022

could you please post the performance test report here?

@suchen-sci
Copy link
Contributor Author

Of course, i am working on this....

@suchen-sci
Copy link
Contributor Author

suchen-sci commented Aug 22, 2022

As we can see, by running handelConn parallel, although setSession only run 10ms, it increases the time go routines get lock and increase the total time to finish the job.

handleConn with setSession out of broker lock:

goos: darwin
goarch: amd64
pkg: github.com/megaease/easegress/pkg/object/mqttproxy
cpu: Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
BenchmarkHandleConn-12              1184            933171 ns/op
PASS
ok      github.com/megaease/easegress/pkg/object/mqttproxy      2.791s

handleConn with setSession in of broker lock:

goos: darwin
goarch: amd64
pkg: github.com/megaease/easegress/pkg/object/mqttproxy
cpu: Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
BenchmarkHandleConn-12               100          11280488 ns/op
PASS
ok      github.com/megaease/easegress/pkg/object/mqttproxy      2.894s

handleConn with setSession out of broker lock and use validation:

goos: darwin
goarch: amd64
pkg: github.com/megaease/easegress/pkg/object/mqttproxy
cpu: Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
BenchmarkHandleConn-12              1090            947877 ns/op
PASS
ok      github.com/megaease/easegress/pkg/object/mqttproxy      2.954s

handleConn with setSession in of broker lock and use validation:

goos: darwin
goarch: amd64
pkg: github.com/megaease/easegress/pkg/object/mqttproxy
cpu: Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
BenchmarkHandleConn-12               100          11349362 ns/op
PASS
ok      github.com/megaease/easegress/pkg/object/mqttproxy      2.911s

only validation:

goos: darwin
goarch: amd64
pkg: github.com/megaease/easegress/pkg/object/mqttproxy
cpu: Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
BenchmarkHandleConn-12           1127745               970.6 ns/op
PASS
ok      github.com/megaease/easegress/pkg/object/mqttproxy      3.657s

@suchen-sci suchen-sci merged commit 17773b1 into easegress-io:main Aug 22, 2022
@suchen-sci suchen-sci deleted the speed-up-mqttproxy-connect branch August 22, 2022 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants