Issue
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 :
@Bean("restTemplate") public RestTemplate createRestTemplate(RestTemplateBuilder builder) { log.info("RestTemplate.."); return builder .setConnectTimeout(Duration.ofMillis(5000)) .setReadTimeout(Duration.ofMillis(40000)) .build(); }
tomcat webservice config in application.yml :
tomcat:
max-connections: 2000
connection-timeout: 600s
threads:
max: 100000 jetty:
connection-idle-timeout: 10s
how I can resole this problem ?
Solution
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.