5 ms·
It is problematic if you want to have millions of tcp connections serviced from the same host. https://groups.google.com/forum/#!topic/golang-nuts/8cXGTWGUzWw
by turnip1979 13y ago
It is problematic if you want to have millions of tcp connections serviced from the same host.
https://groups.google.com/forum/#!topic/golang-nuts/8cXGTWGUzWw https://groups.google.com/forum/#!topic/golang-nuts/8cXGTWGU...
- f2f 13y agotoo bad, it can't be changed now. that would require editing a number and recompiling!
- turnip1979 13y agoCan't reply to the f2f's snarky comment. I'm not saying I don't know how to change the value. I want to understand why the designers made the decision to do so.
- 4ad 13y agoThen read the three links pointing above?
- turnip1979 13y agoAll I see are a few perf graphs that show a 20% runtime reduction in a few cases and > 50% reduction in one case. This gives me no insight whatsoever what is going on under the hood. Is it that for these dozen or so benchmarks, we end up using > 4K and < 8K of heap? So the extra 20% time is just going into a memory allocation? P.S. Interesting that I got two snarky comments asking for a basic question about Go. Does not bode well.
- voidlogic 13y ago>Is it that for these dozen or so benchmarks, we end up using > 4K and < 8K of heap? stack, not heap. We are talking about changing the default stack size. >So the extra 20% time is just going into a memory allocation? Yes and the book keeping overhead involved at the OS and runtime levels.
- rdtsc 13y agoIf you have to handle that many connections, I would suggest looking at Erlang. Its default heap of a process is < 3K. Usually that shouldn't matter as much as both have small process sizes compared to OS threads or processes. But at millions of connections it starts to matter. Whatsapp for example, was running on FreeBSD and Erlang with 2M+ connections.
- ballard 13y agoGo needs optional arguments for goroutines and have global defaults because recompiling is ludicrous. Erlang is an ok language with a great runtime. Elixir is much higher level language and hence more productive for teams that already know Erlang but want to write less code and build faster. Also with Erlang, static type checking not used much in Erlang and big loss unless you use dialyzer. Advantage go for compiling and running test cases laser-blindingly fast. There is a native QuickCheck framework for Erlang, and I'm sure someone wrote a go one.
- enneff 13y agoHave you tried recompiling Go? This is building the tool chain and standard library on my modest machine with a cold cache: $ time ./make.bash real 0m42.763s user 1m11.655s sys 0m13.411s Hardly a colossal burden.
- ballard 13y agoI've run it a zillion times. That's not the point, and that doesn't solve the problem. The point is per goroutine configurable stack sizes.
- ballard 13y agoHow much minimum overhead (kernel and userland) per socket is there with a single process watching as many sockets as reliable via select/epoll/kqueue? Say a setup in C for simplicity's sake. Would be an interesting experiment.
- voidlogic 13y agoMy understanding is the second page of that 8 KB is allocated in a virtual memory sense, not a physical one. As the stack grows once it is larger than 4 KB there will be a page fault and the 2nd page will become backed. So the memory situation should be no worse then before this change was made... The guy having issues in that thread was trying to handle major load with a machine with < 8 GB of memory. All my production boxes have 128-256 GB... I had some 16 and 32 GB for a long time with no issues.