From 8093b8b8a39873d3eec84925d0beb00edd428615 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=8A=B9=EC=A7=84?= Date: Fri, 25 Oct 2024 21:20:19 +0900 Subject: [PATCH 1/2] [FIX] thread pool size setting --- .../backend/config/rabbitmq/RabbitMQConfig.java | 16 ++++++++++++++++ .../twtw/backend/config/socket/StompConfig.java | 8 ++++---- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/backend/src/main/java/com/twtw/backend/config/rabbitmq/RabbitMQConfig.java b/backend/src/main/java/com/twtw/backend/config/rabbitmq/RabbitMQConfig.java index 807f5b7..4ede7c4 100644 --- a/backend/src/main/java/com/twtw/backend/config/rabbitmq/RabbitMQConfig.java +++ b/backend/src/main/java/com/twtw/backend/config/rabbitmq/RabbitMQConfig.java @@ -132,8 +132,24 @@ public SimpleRabbitListenerContainerFactory rabbitListenerContainerFactory( final SimpleRabbitListenerContainerFactory factory = new SimpleRabbitListenerContainerFactory(); factory.setConnectionFactory(connectionFactory); +<<<<<<< Updated upstream factory.setConcurrentConsumers(20); factory.setMaxConcurrentConsumers(200); +======= + factory.setConcurrentConsumers(10); + factory.setMaxConcurrentConsumers(50); + return factory; + } + + @Bean + public SimpleRabbitListenerContainerFactory retryRabbitListenerContainerFactory( + ConnectionFactory connectionFactory) { + final SimpleRabbitListenerContainerFactory factory = + new SimpleRabbitListenerContainerFactory(); + factory.setConnectionFactory(connectionFactory); + factory.setConcurrentConsumers(5); + factory.setMaxConcurrentConsumers(25); +>>>>>>> Stashed changes factory.setRetryTemplate(retryTemplate()); return factory; } diff --git a/backend/src/main/java/com/twtw/backend/config/socket/StompConfig.java b/backend/src/main/java/com/twtw/backend/config/socket/StompConfig.java index 36a3e90..85dbcd5 100644 --- a/backend/src/main/java/com/twtw/backend/config/socket/StompConfig.java +++ b/backend/src/main/java/com/twtw/backend/config/socket/StompConfig.java @@ -55,8 +55,8 @@ public void configureClientOutboundChannel(final ChannelRegistration registratio @Bean public ThreadPoolTaskExecutor inboundTaskExecutor() { final ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); - executor.setCorePoolSize(15); - executor.setMaxPoolSize(150); + executor.setCorePoolSize(10); + executor.setMaxPoolSize(20); executor.setThreadNamePrefix("stomp-inbound-"); executor.initialize(); return executor; @@ -65,8 +65,8 @@ public ThreadPoolTaskExecutor inboundTaskExecutor() { @Bean public ThreadPoolTaskExecutor outboundTaskExecutor() { final ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); - executor.setCorePoolSize(20); - executor.setMaxPoolSize(200); + executor.setCorePoolSize(10); + executor.setMaxPoolSize(20); executor.setThreadNamePrefix("stomp-outbound-"); executor.initialize(); return executor; From 9163945e3289bfc21bf0269c4dfe45b83b591efc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=8A=B9=EC=A7=84?= Date: Fri, 25 Oct 2024 21:20:19 +0900 Subject: [PATCH 2/2] [FIX] thread pool size setting --- .../twtw/backend/config/rabbitmq/RabbitMQConfig.java | 12 ++++++++++++ .../com/twtw/backend/config/socket/StompConfig.java | 8 ++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/backend/src/main/java/com/twtw/backend/config/rabbitmq/RabbitMQConfig.java b/backend/src/main/java/com/twtw/backend/config/rabbitmq/RabbitMQConfig.java index 0cc03db..ba9d9d2 100644 --- a/backend/src/main/java/com/twtw/backend/config/rabbitmq/RabbitMQConfig.java +++ b/backend/src/main/java/com/twtw/backend/config/rabbitmq/RabbitMQConfig.java @@ -155,8 +155,15 @@ public SimpleRabbitListenerContainerFactory rabbitListenerContainerFactory( final SimpleRabbitListenerContainerFactory factory = new SimpleRabbitListenerContainerFactory(); factory.setConnectionFactory(connectionFactory); +<<<<<<< Updated upstream factory.setConcurrentConsumers(20); factory.setMaxConcurrentConsumers(200); +<<<<<<< HEAD +======= +======= + factory.setConcurrentConsumers(10); + factory.setMaxConcurrentConsumers(50); +>>>>>>> 8093b8b ([FIX] thread pool size setting) return factory; } @@ -167,7 +174,12 @@ public SimpleRabbitListenerContainerFactory retryRabbitListenerContainerFactory( new SimpleRabbitListenerContainerFactory(); factory.setConnectionFactory(connectionFactory); factory.setConcurrentConsumers(5); +<<<<<<< HEAD factory.setMaxConcurrentConsumers(50); +======= + factory.setMaxConcurrentConsumers(25); +>>>>>>> Stashed changes +>>>>>>> 8093b8b ([FIX] thread pool size setting) factory.setRetryTemplate(retryTemplate()); return factory; } diff --git a/backend/src/main/java/com/twtw/backend/config/socket/StompConfig.java b/backend/src/main/java/com/twtw/backend/config/socket/StompConfig.java index 36a3e90..85dbcd5 100644 --- a/backend/src/main/java/com/twtw/backend/config/socket/StompConfig.java +++ b/backend/src/main/java/com/twtw/backend/config/socket/StompConfig.java @@ -55,8 +55,8 @@ public void configureClientOutboundChannel(final ChannelRegistration registratio @Bean public ThreadPoolTaskExecutor inboundTaskExecutor() { final ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); - executor.setCorePoolSize(15); - executor.setMaxPoolSize(150); + executor.setCorePoolSize(10); + executor.setMaxPoolSize(20); executor.setThreadNamePrefix("stomp-inbound-"); executor.initialize(); return executor; @@ -65,8 +65,8 @@ public ThreadPoolTaskExecutor inboundTaskExecutor() { @Bean public ThreadPoolTaskExecutor outboundTaskExecutor() { final ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); - executor.setCorePoolSize(20); - executor.setMaxPoolSize(200); + executor.setCorePoolSize(10); + executor.setMaxPoolSize(20); executor.setThreadNamePrefix("stomp-outbound-"); executor.initialize(); return executor;