3 ms·
But then with a million of threads either M:N or 1:1 you have other problems, namely the whole shared memory multithreading model breaks and you can forget abou
by zzzcpan 8y ago
But then with a million of threads either M:N or 1:1 you have other problems, namely the whole shared memory multithreading model breaks and you can forget about all the locks/channels if you want to actually do something useful with that.
- dboreham 8y agoI believe there are boxes in production with 1E6 live connections.
- marcosdumay 8y agoIf they exist, they are running software written on either C or Rust, that can avoid memory efficiency traps and can schedule their workers on a more optimum way than a general purpose language. That said, I'm not sure such thing exists. Just the memory overhead some common libraries impose on connections is enough to fill some 32GB.
- toast0 8y agoErlang works just fine for that many connections (depending on how much CPU you spend doing real work per connection). Socket buffers are tunable. 32GB isn't that much ram for a server, Android phones are shipping with 6gb, you can get 6TB into a server without getting too exotic.
- NightlyDev 8y ago3 million connections: https://medium.freecodecamp.org/million-websockets-and-go-cc58418460bb https://medium.freecodecamp.org/million-websockets-and-go-cc... Heck, you can probably handle a million connections using PHP(with swoole).
- zzzcpan 8y agoIn the article they got rid of goroutines to get to 3 million connections.
- dboreham 8y ago>That said, I'm not sure such thing exists. Just to clarify : my knowledge on this is pretty deep so the only reason I didn't say "they exist" is that I don't personally have one in my DC (I've only managed up to 200k live connections). I know people very well who do. But yes of course the application would be written in some efficient language fit for the purpose like C, Rust, Go, Erlang. Probably not Java. Also 32GB is not much memory these days.
- cozos 8y agoCan you elaborate on what you mean by "the whole shared memory multithreading model breaking"? I would love to hear ;)