How to change number of worker threads in finch/finagle?

546 Views Asked by At

I have a finch endpoint that works fine when sequential calls are made.in case of concurrent requests, service latency is increasing in the proportion of the number of concurrent requests.I have two questions regarding this.

  1. Is blocking of thread causing latency problem?
  2. How many worker threads are present in finch?
  3. How to increase the number of worker threads?
  4. How will the system affect after changing default worker thread count?
1

There are 1 best solutions below

2
Vladimir Kostyukov On

Blocking a Finagle thread is never a good idea. Normally you get 2 * CPU cores threads in your thread-pool. You can try overriding it with the -Dcom.twitter.finagle.netty4.numWorkers=48 flag.

Before tweaking the thread pool, I'd recommend looking into FuturePools for means to offload your blocking code from a Finagle thread.