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

Benchmarks #17

Closed
ohenepee opened this issue Sep 3, 2017 · 5 comments
Closed

Benchmarks #17

ohenepee opened this issue Sep 3, 2017 · 5 comments

Comments

@ohenepee
Copy link

ohenepee commented Sep 3, 2017

Being low-level, how does it fare against Gorilla WebSockets and the awesome uWebSockets... say for 1 million connections? Primarily when it comes to RAM usage.

@gonzaloserrano
Copy link

@ohenepee
Copy link
Author

ohenepee commented Sep 4, 2017

10kB per connection amounts to 10GB for 1 million connections... if my calculations are correct, that's not so light tho

@ohenepee ohenepee closed this as completed Sep 4, 2017
@ohenepee ohenepee reopened this Sep 4, 2017
@gonzaloserrano
Copy link

How many KB per connection do you think is light enough? I think 10KB is amazing for a Go program where a launching a goroutine is between 4-8KB itself.

@ohenepee
Copy link
Author

ohenepee commented Sep 4, 2017

Yes your statement is very true, when compared to the goroutine allocation.

@ohenepee ohenepee closed this as completed Sep 4, 2017
@gobwas
Copy link
Owner

gobwas commented Sep 4, 2017

Hi @ohenepee, hi @gonzaloserrano =)
Actually, 10KB is not the limit – currently application that is being discussed in the article on medium takes 8KB per connection (with GC_PERCENT set to 75%). But, if your connection does not alive – that is, does not write any data to you and you do not write data to it, then memory allocation could appear only for storing net.Conn if you use some low-level optimizations with linux epoll (see easygo/netpoll).

Thus, it much depends on use cases and behaviour patterns of your connections. For example, if some read event occur on connection, which size of the read buffer you will use? So it also makes differences on memory consumption.

Cheers !👍
Sergey.

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

No branches or pull requests

3 participants