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 ?