diff --git a/src/main/kotlin/io/emeraldpay/dshackle/GrpcServer.kt b/src/main/kotlin/io/emeraldpay/dshackle/GrpcServer.kt index cb558725..2102fe77 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/GrpcServer.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/GrpcServer.kt @@ -16,6 +16,7 @@ */ package io.emeraldpay.dshackle +import com.google.common.util.concurrent.ThreadFactoryBuilder import io.emeraldpay.dshackle.config.MainConfig import io.emeraldpay.dshackle.monitoring.accesslog.AccessHandlerGrpc import io.grpc.Server @@ -24,6 +25,7 @@ import org.slf4j.LoggerFactory import org.springframework.beans.factory.annotation.Autowired import org.springframework.stereotype.Service import java.net.InetSocketAddress +import java.util.concurrent.Executors import javax.annotation.PostConstruct import javax.annotation.PreDestroy @@ -63,6 +65,13 @@ open class GrpcServer( serverBuilder.addService(it) } + serverBuilder.executor( + Executors.newFixedThreadPool( + 20, + ThreadFactoryBuilder().setNameFormat("custom-grpc-%d").build() + ) + ) + val server = serverBuilder.build() this.server = server