我的简单对象是这样的:
pom.xml
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.10.RELEASE</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>
</dependencies>
<!-- Package as an executable jar -->
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
类是这样的:
@RestController
@SpringBootApplication
public class Example {
@RequestMapping("/")
String home() {
return "Hello World!__";
}
public static void main(String[] args) throws Exception {
SpringApplication.run(Example.class, args);
}
}
执行命令:
/home/gdct/jdk1.8.0_152/bin/java -server -Xms1g -Xmx1g -XX:MetaspaceSize=128M -XX:MaxMetaspaceSize=256m -jar /home/gdct/abc/aembedjar.jar --server.port=9998
一开始TPS是3600,几分钟后TPS是1500。(慢慢来)
请帮帮我,如何保持TPS是3500(或其他数字)左右???
注意:我测试了一个 webservice api,它可以保持 tps。