TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Evio – Fast event-loop networking for Go

281 pointsby Acconutover 7 years ago

9 comments

tidwallover 7 years ago
This project is not intended to be a general purpose replacement for the standard Go net package or goroutines. It&#x27;s for building specialized services such as key value stores, L7 proxies, static websites, etc.<p>You would not want to use this framework if you need to handle long-running requests (milliseconds or more). For example, a web api that needs to connect to a mongo database, authenticate, and respond; just use the Go net&#x2F;http package instead.<p>There are many popular event loop based applications in the wild such as Nginx, Haproxy, Redis, and Memcached. All of these are single-threaded and very fast and written in C.<p>The reason I wrote this framework is so I can build certain network services that perform like the C apps above, but I also want to continue to work in Go.
评论 #15625293 未加载
评论 #15627163 未加载
crawshawover 7 years ago
One of my favorite things about Go is that it cuts through the &quot;threads vs. events&quot; debate by offering thread-style programming with event-style scaling using what you might call green threads (compiler assisted cooperative multitasking that has the programming semantics of preemptive multitasking).<p>That is, I can write simple blocking code, and my server still scales.<p>Using event loop programming in Go would take away one of my favorite things about the language, so I won&#x27;t be using this. However I do appreciate the work, as it makes an excellent bug report against the Go runtime. It gives us a standard to hold the standard library&#x27;s net package to.
评论 #15625394 未加载
评论 #15626665 未加载
评论 #15627685 未加载
oliviervaover 7 years ago
The Go network stack already makes use of epoll and kqueue: <a href="https:&#x2F;&#x2F;golang.org&#x2F;src&#x2F;runtime&#x2F;netpoll_epoll.go" rel="nofollow">https:&#x2F;&#x2F;golang.org&#x2F;src&#x2F;runtime&#x2F;netpoll_epoll.go</a> So I&#x27;m not quiet sure why this would be faster since almost all I&#x2F;O in Go is event driven, including the networking stack.
评论 #15624632 未加载
评论 #15624614 未加载
fooycover 7 years ago
I love Go because I never had to write asynchronous, callback driven programs in this language. I hope it won&#x27;t become the norm in Go, too.
评论 #15625184 未加载
indescions_2017over 7 years ago
I&#x27;d be interested in the level seven reverse proxy application. As well as unix domain socket message queues. There are probably many other places in the networking pipeline evio could provide a boost.<p>It&#x27;s a testament to what is possible through the &quot;syscall&quot; and &quot;golang&#x2F;x&#x2F;sys&quot; facilities. As well as your confidence in playing with Linux internals ;)
评论 #15625164 未加载
bsaulover 7 years ago
Not sure i understand what the use case is. As soon as you start doing something on the event loop , you need some kind of way to perform the operation in another &quot;thread&quot; ( or goroutine or whatever). And then you start to need some kind of concurrency mechanism, and pay the price.<p>Stripping those mechanism to pretend the event handling is faster only works if you never intend to have some real computation performed. That&#x27;s never true in practice... Or am i missing something ?
评论 #15625282 未加载
brian-armstrongover 7 years ago
At this point, why not just use C++? I feel like people are trying to stretch Go way past what it&#x27;s good for. It&#x27;s not going to replace C++ where C++ is effective, and it shouldn&#x27;t :)
评论 #15626678 未加载
adrianratnapalaover 7 years ago
Worst of both worlds, only faster?
cdoxseyover 7 years ago
This is single-threaded? What are you going to do with the other 31 or 63 cores?<p>The single-threaded nature of applications liked Redis an Haproxy is a singificant impediment to their vertical scalability. CPUs aren&#x27;t getting faster, we&#x27;re just going to get more cores, so anything that assumes there&#x27;s only a single core seems like a dead end.<p>Haproxy literally just added multithreading support in 1.8.
评论 #15626858 未加载
评论 #15626865 未加载