I use Finalge https://twitter.github.io/finagle/
to test the timeout case like this:
within
like within(50.milliseconds) onSuccess { ... } onFailure { ... }
The result is that all the RPCs are timeout of course. But, when I use netstat
to check the connection I find that there are 100 ESTABLISHED
connection. The question is can I limit the connections number Finagle create ?
Yes, you can use
hostConnectionLimit(10)
in your ClientBuilder to limit the connections to each host. "Host" here refers to the server side boxes.
Source code here.