From 881697eb5866e83351a95fef8de45858ee21bbd9 Mon Sep 17 00:00:00 2001 From: skynetcap <100323448+skynetcap@users.noreply.github.com> Date: Sat, 20 Jan 2024 11:11:12 -0800 Subject: [PATCH] Increase thread pool size and modify manager instantiation Increased the scheduled thread pool size from 2 to 8 in the 'ObCrankerApplication.java' and adjusted the instantiation of 'OpenBookManager'. These adjustments aim to speed up concurrent task processing and optimize the manager's RPC client with additional parameters, thus potentially improving the overall app performance and functionality. --- .../markets/arcana/obcranker/ObCrankerApplication.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/markets/arcana/obcranker/ObCrankerApplication.java b/src/main/java/markets/arcana/obcranker/ObCrankerApplication.java index d693e35..6da495c 100644 --- a/src/main/java/markets/arcana/obcranker/ObCrankerApplication.java +++ b/src/main/java/markets/arcana/obcranker/ObCrankerApplication.java @@ -30,7 +30,7 @@ public class ObCrankerApplication { @Value("${application.privateKey}") private String privateKeyFileName; - private final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(2); + private final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(8); public static void main(String[] args) { SpringApplication.run(ObCrankerApplication.class, args); @@ -38,7 +38,7 @@ public static void main(String[] args) { @EventListener(ApplicationReadyEvent.class) public void crankEventHeapLoop() { - OpenBookManager manager = new OpenBookManager(new RpcClient(endpoint)); + OpenBookManager manager = new OpenBookManager(new RpcClient(endpoint, 5)); Account tradingAccount = null; try { @@ -60,9 +60,9 @@ public void crankEventHeapLoop() { ); if (transactionId.isPresent()) { - log.info("Cranked events: {}", transactionId.get()); + log.info("Cranked primary events: {}", transactionId.get()); } else { - log.info("No events found to consume."); + log.info("No primary events found to consume."); } } catch (Exception ex) { log.error("Error cranking SOL/USDC: {}", ex.getMessage(), ex);