xtaci / smux

A Stream Multiplexing Library for golang with least memory usage(TDMA)
MIT License
1.27k stars 189 forks source link

add ability to turn off keepalive #72

Closed sintanial closed 4 years ago

sintanial commented 4 years ago

Added ability to turn off keepalive in settings.

It's need to be optional, because in some cases it's better to use TCP Keepalive.

For example in my case when i handling 150-200k alive connections, GC begins to spend resources on the cleaning timers from smux keepalive. And enabling TCP keepalive help to me to reduce GC spend time

codecov[bot] commented 4 years ago

Codecov Report

Merging #72 into master will decrease coverage by 0.37%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #72      +/-   ##
==========================================
- Coverage   83.42%   83.05%   -0.38%     
==========================================
  Files           6        6              
  Lines         706      708       +2     
==========================================
- Hits          589      588       -1     
- Misses         97      100       +3     
  Partials       20       20              
Impacted Files Coverage Δ
mux.go 90.24% <100.00%> (+0.24%) :arrow_up:
session.go 79.06% <100.00%> (-0.94%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 0276e0f...e3f47c7. Read the comment docs.