Il giorno domenica 5 marzo 2017 16:13:08 UTC+1, Nick Rio ha scritto: > > Greeting people, > > *TL;DR: The only option is to work with syscall package and build > everything ground up, or there are some easier way?* > > The story is, I'm working on a network related project ( > https://github.com/nickrio/coward) which been designed to take a lots of > connections. Most of those connections is just idle, but hey can back to > active at any time. > > Currently, that application is implemented in Go's style -- When a new > connection is accepted, a new goroutine is created, along with associated > buffer and structs. > > The downside of that is, I have to create a buffer for each goroutine (for > each connection), no matter that connection is active or not. >
You would probably need to create a buffer for each connection even when using epoll. And because of that, there will be a lots of memory space been wasted > (goroutine also cost few KB of memories). > > Are you **really** sure that the additional memory required by the goroutines will be a problem for your application? > So I'm thinking, if I can somehow re-implement connection handling in > epoll-like model, then I could save those idle memory for better memory > efficiency. > > Idle connections will still need some memory: the memory you need to store for the per connection state. > [...] Manlio -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
