Skip to content

Commit

Permalink
Fix and comment Tomcat configuration
Browse files Browse the repository at this point in the history
* comment choices in Tomcat configuration
* disable access logs; performance boost...
  • Loading branch information
bclozel committed Mar 4, 2014
1 parent c2589fe commit 1c054c5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ public class TomcatCustomizer implements EmbeddedServletContainerCustomizer {
@Value("${tomcat.connector.maxConnections}")
private int maxConnections;

@Value("${tomcat.connector.acceptCount}")
private int acceptCount;

@Value("${tomcat.connector.maxKeepAliveRequests}")
private int maxKeepAliveRequests;

Expand All @@ -45,7 +48,7 @@ public void customize(Connector connector) {
protocol.setConnectionTimeout(connectionTimeout);
protocol.setMaxConnections(maxConnections);
}
connector.setProperty("acceptCount", maxConnections+"");
connector.setProperty("acceptCount", acceptCount+"");
connector.setProperty("maxKeepAliveRequests", maxKeepAliveRequests+"");
}
}
Expand Down
9 changes: 9 additions & 0 deletions spring/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,20 @@ spring:

tomcat:
connector:
# reduce context switching; Intel Xeons have 12 threads
maxThreads: 12
connectionTimeout: 20000
# maximum: 16K connections test
maxConnections: 20000
# handle initial connection spike
acceptCount: 20000
# avoid running out of ports due to connections stuck in TIME_WAIT state
maxKeepAliveRequests: -1

server:
tomcat:
access_log_enabled: false

---
spring:
profiles: local
Expand Down

0 comments on commit 1c054c5

Please sign in to comment.