keytool -genkey -alias tomcat -keyalg RSA
server: tomcat: max-threads: 100 min-spare-threads: 20 connection-timeout: 5000 ssl: key-store: classpath:.keystore key-store-type: JKS key-password: qq123456 key-alias: tomcat port: 8443
@SpringBootApplication
public class AppApplication {
public static void main(String args[]) {
SpringApplication.run(AppApplication.class, args);
}
@Bean
public EmbeddedServletContainerFactory tomcatEmbeddedServletContainerFactory() throws IOException {
TomcatEmbeddedServletContainerFactory tomcat = new TomcatEmbeddedServletContainerFactory();
tomcat.addAdditionalTomcatConnectors(httpConnector());
return tomcat;
}
public Connector httpConnector() throws IOException {
Connector connector = new Connector("org.apache.coyote.http11.Http11NioProtocol");
Http11NioProtocol http11NioProtocol = (Http11NioProtocol) connector.getProtocolHandler();
connector.setPort(8080);
//设置最大线程数
http11NioProtocol.setMaxThreads(100);
//设置初始线程数 最小空闲线程数
http11NioProtocol.setMinSpareThreads(20);
//设置超时
http11NioProtocol.setConnectionTimeout(5000);
return connector;
}
}
2016-11-21 10:53:15.247 INFO 42382 --- [ main] com.start.AppApplication : Starting AppApplication on elemebjdeMacBook-Pro.local with PID 42382 (/Users/wangkang/code/SpringBoot-Learn/springboot-9/target/classes started by wangkang in /Users/wangkang/code/SpringBoot-Learn) 2016-11-21 10:53:15.251 INFO 42382 --- [ main] com.start.AppApplication : No active profile set, falling back to default profiles: default 2016-11-21 10:53:15.426 INFO 42382 --- [ main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@489115ef: startup date [Mon Nov 21 10:53:15 CST 2016]; root of context hierarchy 2016-11-21 10:53:19.164 INFO 42382 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat initialized with port(s): 8443 (https) 8080 (http) 2016-11-21 10:53:19.193 INFO 42382 --- [ main] o.apache.catalina.core.StandardService : Starting service Tomcat 2016-11-21 10:53:19.194 INFO 42382 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.5
java -Xms4g -Xmx4g -Xmn768m -server -jar springboot-9-1.4.1.RELEASE.jar
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-jetty</artifactId> </dependency>
@Profile("jetty")
@Bean
public JettyEmbeddedServletContainerFactory jettyEmbeddedServletContainerFactory(
JettyServerCustomizer jettyServerCustomizer) {
JettyEmbeddedServletContainerFactory factory = new JettyEmbeddedServletContainerFactory();
factory.addServerCustomizers(jettyServerCustomizer);
return factory;
}
@Bean
public JettyServerCustomizer jettyServerCustomizer() {
return server -> {
// Tweak the connection config used by Jetty to handle incoming HTTP
// connections
final QueuedThreadPool threadPool = server.getBean(QueuedThreadPool.class);
threadPool.setMaxThreads(100);
threadPool.setMinThreads(20);
};
}
server: connection-timeout: 5000 ssl: key-store: classpath:.keystore key-store-type: JKS key-password: qq123456 key-alias: tomcat port: 8444
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有