Skip to content

Commit

Permalink
rename event.worker.pool to kernel.thread.pool
Browse files Browse the repository at this point in the history
  • Loading branch information
acn-ericlaw committed Feb 14, 2024
1 parent c0938c7 commit 253931e
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed

1. Open sources library update (Spring Boot 3.2.2, Vertx 4.5.3 and MsgPack 0.9.8)
2. Rename application parameter "event.worker.pool" to "kernel.thread.pool"

---
## Version 3.0.8, 1/27/2024
Expand Down
2 changes: 1 addition & 1 deletion arch-decisions/DESIGN-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ You can precisely control how your functions execute, using kernel thread pool,
to address various use cases to yield the highest performance and throughput.

Kernel threads provide the highest performance in terms of operations per second when the number of threads is smaller.
As a rule of thumb, do not set "event.worker.pool" higher than 200.
As a rule of thumb, do not set "kernel.thread.pool" higher than 200.

Coroutine is ideal for functions that execute very quickly to yield control to other coroutines.

Expand Down
4 changes: 2 additions & 2 deletions guides/CHAPTER-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,15 @@ When you write a function using LambdaFunction and TypedLambdaFunction, the func
While preemptive multitasking fully utilizes the CPU, its context switching overheads may increase as the number of
kernel threads grow. As a rule of thumb, you should control the maximum number of kernel threads to less than 200.

The parameter `event.worker.pool` is defined with a default value of 100. You can change this value to adjust to
The parameter `kernel.thread.pool` is defined with a default value of 100. You can change this value to adjust to
the actual CPU power in your environment. Keep the default value for best performance unless you have tested the
limit in your environment.

> When you have more concurrent requests, your application may slow down because some functions
are blocked when the number of concurrent kernel threads is reached.

You should reduce the number of "instances" (i.e. worker pool) for a function to a small number so that your
application does not exceed the maximum limit of the `event.worker.pool` parameter.
application does not exceed the maximum limit of the `kernel.thread.pool` parameter.

Kernel threads are precious and finite resources. When your function is computational intensive or making
external HTTP or database calls in a synchronous blocking manner, you may use it with a small number
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public static Platform getInstance() {
private static void initialize() {
if (initCounter.incrementAndGet() == 1) {
AppConfigReader config = AppConfigReader.getInstance();
int poolSize = Math.max(32, Utility.getInstance().str2int(config.getProperty("event.worker.pool", "100")));
int poolSize = Math.max(32, Utility.getInstance().str2int(config.getProperty("kernel.thread.pool", "100")));
system = Vertx.vertx().eventBus();
vertx = Vertx.vertx();
cache = SimpleCache.createCache("system.log.cache", 30000);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public void concurrentEventTest() throws InterruptedException {
final BlockingQueue<Boolean> wait = new ArrayBlockingQueue<>(1);
final AppConfigReader config = AppConfigReader.getInstance();
final Utility util = Utility.getInstance();
int poolSize = Math.max(32, util.str2int(config.getProperty("event.worker.pool", "100")));
int poolSize = Math.max(32, util.str2int(config.getProperty("kernel.thread.pool", "100")));
final ExecutorService executor = Platform.getInstance().getEventExecutor();
final String RPC_FORWARDER = "rpc.forwarder";
final String SLOW_SERVICE = "artificial.delay";
Expand Down

0 comments on commit 253931e

Please sign in to comment.