springboot学习笔记

1.性能优化

1.1 不使用@SpringBootApplication,按需加载

@SpringBootConfiguration
@EnableAutoConfiguration
@ComponentScan(value={"com.example.demo.rest"})

1.2 合理修改jvm参数,减少gc

-XX:+PrintGCDetails -Xmx1024m -Xms1024m

1.3 使用undertow替代tomcat

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<!--excludethetomcatdependency-->
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<!--includetheundertowdependency-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>


1.4 如何使用jmeter做性能测试比较

1.4.1 create the [Thread Group]

1.4.2 create [HTTP Request]

1.4.3 add [HTTP Header Manager]

1.4.4 add [Aggregate Report]

2.多数据源配置

3.

posted on 2019-04-29 21:59  lukelin1989  阅读(152)  评论(0编辑  收藏  举报

导航