Skip to content

Commit

Permalink
Optimize tcp read/write operations
Browse files Browse the repository at this point in the history
read: use goroutine with timer per each connection
 to handle keep alive insdead of using SetReadDeadline
 which requires call to time.Now. That leads to lots of
 syscalls on heavy loaded connections

write: use net.Buffers to perform batch writes.
 buffers flushed every 1ms (tune this period if needed)

Signed-off-by: Artur Troian <[email protected]>
  • Loading branch information
troian committed Aug 28, 2017
1 parent 3680135 commit 25b9c8f
Show file tree
Hide file tree
Showing 10 changed files with 140 additions and 1,036 deletions.
8 changes: 7 additions & 1 deletion Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 25b9c8f

Please sign in to comment.