-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
finagle-core: Add low priority offload executor
Problem In latency-critical applications, there may be tasks that are not essential for serving a request, such as publishing statistics. However, these tasks can be numerous and even demanding in terms of computational resources. They can saturate the entire offload pool queue and cause delays in processing user requests. Solution A solution to this problem could be a low-critical pool where such tasks can be placed. It is a separate pool with its own queue and dedicated processing threads. This change also introduces primitives for client code to allow them to publish low-priority tasks to this pool. Differential Revision: https://phabricator.twitter.biz/D1189064
- Loading branch information
Ivan Gorbachev
authored and
jenkins
committed
Jan 14, 2025
1 parent
c8582af
commit 10fcab3
Showing
3 changed files
with
63 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
finagle-core/src/main/scala/com/twitter/finagle/offload/lowPriorityNumWorkers.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package com.twitter.finagle.offload | ||
|
||
import com.twitter.app.GlobalFlag | ||
|
||
object lowPriorityNumWorkers | ||
extends GlobalFlag[Int]( | ||
"""Experimental flag. Enables the low priority offload pool using a thread pool with the specified number of threads. | ||
| When this flag is greater that zero, the execution of low priority tasks happen in an isolated pool. | ||
|""".stripMargin) |