Skip to content

Commit 2f2e11a

Browse files
committed
add the reason why choose 3 threads for ForkJoinPool
1 parent 2666f98 commit 2f2e11a

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

framework/src/main/java/org/tron/core/services/jsonrpc/TronJsonRpcImpl.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,12 @@ public enum RequestSource {
169169

170170
private static final String ERROR_SELECTOR = "08c379a0"; // Function selector for Error(string)
171171
private final int filterParallelThreshold = 10000;
172-
private final ForkJoinPool logsFilterPool = new ForkJoinPool(2);
172+
/**
173+
* Using the default maxLogFilterNum of 20,000, a 3-thread pool can keep up with log event
174+
* processing for each block within the 3-second BLOCK_PRODUCED_INTERVAL. Increasing the thread
175+
* pool size too much may affect the performance of the main block processing thread.
176+
*/
177+
private final ForkJoinPool logsFilterPool = new ForkJoinPool(3);
173178
/**
174179
* thread pool of query section bloom store
175180
*/

0 commit comments

Comments
 (0)