|
|
|
|
|
by jpollock
1510 days ago
|
|
This isn't about the hardware, it's about thread count. There are limits in the linux kernel, and the 5m concurrent connections was chosen to exceed it. From what I remember (my knowledge is ancient though), a Java thread consumes a pid_t in the linux kernel. By default this is limited to 64k. However, this can be increased by setting a flag in the kernel, to a maximum 2^22 or 4m. In order to have more than 4m connections, the existing Java code either needs to be changed to be event driven, or it can't use kernel threads. Event driven code is very different. It's very powerful, but it is very easy to get lost. Think writing Java code that looks like a Makefile with dependencies or "andThen" everywhere, and everyone having to make sure everything is threadsafe. Thread safety is hard for large teams with high qps services - deadlocks can bring down a service. If a developer can write "regular" non-re-entrant Java code and still get the concurrent connections? Win all around. |
|