From 7af77d9af26823bcb39b709b29a11d8b388c87f8 Mon Sep 17 00:00:00 2001 From: Danno Ferrin Date: Mon, 2 Dec 2019 13:59:42 -0700 Subject: [PATCH] Multithread Websockets to increass throughput Vertx by default orders all calls to executeBlocking in an ordered fashion. As a side effect all requests are single threaded, even across multiple clients. Because JSON-RPC has request identifiers it is not needed to thread responses as they can be answered out of order. This also allows multiple threads to handle requests, increasing throughput. Signed-off-by: Danno Ferrin --- .../ethereum/api/jsonrpc/websocket/WebSocketRequestHandler.java | 1 + 1 file changed, 1 insertion(+) diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/websocket/WebSocketRequestHandler.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/websocket/WebSocketRequestHandler.java index 505babbf808..71d6978010d 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/websocket/WebSocketRequestHandler.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/websocket/WebSocketRequestHandler.java @@ -88,6 +88,7 @@ public void handle( future.complete(new JsonRpcErrorResponse(request.getId(), JsonRpcError.INTERNAL_ERROR)); } }, + false, result -> { if (result.succeeded()) { replyToClient(id, Json.encodeToBuffer(result.result()));