Skip to content

Commit

Permalink
Increase thread pool size and modify manager instantiation
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
skynetcap committed Jan 20, 2024
1 parent 83cb795 commit 881697e
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ 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);
}

@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 {
Expand All @@ -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);
Expand Down

0 comments on commit 881697e

Please sign in to comment.