504 in communication between microservices


This Content is from Stack Overflow. Question asked by Masoud Shahhosseini

I am working in a Spring boot project and deploy on 3 nodes docker swarm worker as a replicate, When goes under heavy load after 150 request it’s get 504 gateway timeout and didn’t response until reload. after reload container everything it we’ll be OK.

Rest Template config :

public RestTemplate createRestTemplate(RestTemplateBuilder builder) {
    return builder

tomcat webservice config in application.yml :

max-connections: 2000
connection-timeout: 600s
max: 100000 jetty:
connection-idle-timeout: 10s

how I can resole this problem ?


This question is not yet answered, be the first one who answer using the comment. Later the confirmed answer will be published as the solution.

This Question and Answer are collected from stackoverflow and tested by JTuto community, is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?