emersion / go-imap

📥 An IMAP library for clients and servers
MIT License
2.09k stars 296 forks source link

How many simultaneous IMAP email accounts can this client handle? #86

Closed neatcode closed 7 years ago

neatcode commented 7 years ago

On a single, say $2500 dedicated server (average high end server), how many simultaneous connected IMAP email accounts do you think this client could handle?

Ie. how scalable is this client? assuming everything else is dummy code but the dummy code performs actions on each user account every 10 minutes or so like LIST or FETCH. assume db interaction is "free" in terms of performance for the purposes of this question.

just looking for a ball-park.

emersion commented 7 years ago

I don't really know. The only way to check would be to test. If you can, try to open as many connections as possible with a fake network:

cc, sc := net.Pipe()
go sc.Write("* OK IMAP4rev1 Service Ready\r\n")
c, err := client.New(cc)

The client is just a wrapper around net.Conn. It starts a few goroutines and consumes a little more memory than just a net.Conn.

neatcode commented 7 years ago

From other sources my guess it's about 5,000 simultaneous connections tops, which wouldn't be adequate for my desired application. Thank you for your answer.

neatcode commented 7 years ago

Ie. this is a limitation of the Go language.

emersion commented 7 years ago

See also https://groups.google.com/forum/m/#!topic/golang-nuts/coc6bAl2kPM

Go should be able to handle more connections than Nodejs, but less than C.

neatcode commented 7 years ago

FYI WhatsApp gets 2 million concurrent connections per server using Erlang. I think Erlang/Elixir is my solution. Any thoughts on how they compare to Go?