[root@f java]# tail -30 nohup.out
searchES-TimeMillisSpent:448
P->1602@fT->http-nio-8080-exec-3t->池州小型柴油机移动泵哪家好kw->柴油机移动泵kws->柴油机移动泵,柴油机水泵机组,自吸柴油机泵
searchES-TimeMillisSpent:387
P->1602@fT->http-nio-8080-exec-10t->东莞知名6061铝合金价格kw->6061铝合金kws->6061铝合金,铝材制造,灯饰铝材
searchES-TimeMillisSpent:661
P->1602@fT->http-nio-8080-exec-6t->中山知名私人聚会外卖服务为先kw->私人聚会kws->私人聚会,冷餐会服务,烹饪队
searchES-TimeMillisSpent:778
P->1602@fT->http-nio-8080-exec-5t->青岛智能干式过滤器系统kw->干式过滤器kws->干式过滤器,废气处理工程,直接燃烧炉
searchES-TimeMillisSpent:469
P->1602@fT->http-nio-8080-exec-7t->金川开发区知名3-6岁潜能培训哪家好kw->3-6岁潜能培训kws->3-6岁潜能培训,学前教育,宝宝潜能开发
searchES-TimeMillisSpent:667
P->1602@fT->http-nio-8080-exec-9t->四川靠谱的宝宝早教机构老师水平怎么kw->宝宝早教kws->宝宝早教,儿童早教,家庭早教加盟
searchES-TimeMillisSpent:420
P->1602@fT->http-nio-8080-exec-2t->韶关正规扫码共享充电批发kw->扫码共享充电kws->扫码共享充电,宾馆小型售货机,扫码充电线
searchES-TimeMillisSpent:30
P->1602@fT->http-nio-8080-exec-10t->盛芯泰销售优质的ISL31492EIBZ原装货卖kw->ISL31492EIBZkws->ISL31492EIBZ,ISL3159EFBZ,ISL32478EIBZ
searchES-TimeMillisSpent:456
P->1602@fT->http-nio-8080-exec-5t->河源生产环保烘干机厂家kw->环保烘干机kws->环保烘干机,节能烘干机,面条烘干机
searchES-TimeMillisSpent:423
P->1602@fT->http-nio-8080-exec-7t->云南正规冷板选哪家kw->冷板kws->冷板,角铁,钢结构
searchES-TimeMillisSpent:598
P->1602@fT->http-nio-8080-exec-3t->横岗街道散打深圳学武术价格价格kw->深圳学武术价格kws->深圳学武术价格,深圳少儿武术,龙岗武术培训班
searchES-TimeMillisSpent:726
P->1602@fT->http-nio-8080-exec-1t->甘肃放心家用空气能热水器哪家好kw->家用空气能热水器kws->家用空气能热水器,OEM热水器,商用空气能热水器
searchES-TimeMillisSpent:355
P->1602@fT->http-nio-8080-exec-9t->安康知名职员办公桌厂家kw->职员办公桌kws->职员办公桌,传统办公家具,玻璃茶几
searchES-TimeMillisSpent:536
P->1602@fT->http-nio-8080-exec-6t->云南昆明高端快题集训机构哪个好kw->快题集训kws->快题集训,短期手绘培训,考研快题辅导
searchES-TimeMillisSpent:355
P->1602@fT->http-nio-8080-exec-5t->襄樊地中海风格火烧石餐桌多少钱kw->火烧石餐桌kws->火烧石餐桌,中式沙发,火烧石餐桌
[root@f java]#

awk  去重

修改初始线程数

server.tomcat.max-threads=100
server.tomcat.minSpareThreads=50 D:\worksp\springtest\src\main\resources\application.properties

rentT->http-nio-8080-exec-39:t->甘南定做公司互联网推广找哪家:kw->公司互联网推广:kws->公司互联网推广,网站建设,网站设计公司
searchES-TimeMillisSpent:683
16213@f:currentT->http-nio-8080-exec-15:t->惠州生产车牌识别收费系统批发价格:kw->车牌识别收费系统:kws->车牌识别收费系统,门禁停车场系统,移动伸缩门
searchES-TimeMillisSpent:348
16213@f:currentT->http-nio-8080-exec-3:t->雁塔区个体外贸公司注册资料:kw->外贸公司注册:kws->外贸公司注册,工商年审,淘丁
searchES-TimeMillisSpent:260
16213@f:currentT->http-nio-8080-exec-41:t->浙江省供应水晶蜜蜡有哪些:kw->水晶蜜蜡:kws->水晶蜜蜡,绿松石桶珠,南红
searchES-TimeMillisSpent:856
16213@f:currentT->http-nio-8080-exec-5:t->滨州知名环保设备工程就业怎么选:kw->环保设备工程就业:kws->环保设备工程就业,环保设备工程专业介绍,光氧催化废气原理图
searchES-TimeMillisSpent:294
16213@f:currentT->http-nio-8080-exec-17:t->东莞有创意的年会场地布置报价:kw->年会场地布置:kws->年会场地布置,年会小品,年会场地选择
searchES-TimeMillisSpent:592
16213@f:currentT->http-nio-8080-exec-16:t->内蒙古自治区资深景观投影灯定制:kw->景观投影灯:kws->景观投影灯,logo灯,定制logo灯
searchES-TimeMillisSpent:693
16213@f:currentT->http-nio-8080-exec-31:t->大同设计广告用板报价:kw->广告用板:kws->广告用板,铺车底塑料板,煤仓衬板
searchES-TimeMillisSpent:595
16213@f:currentT->http-nio-8080-exec-9:t->肇庆投资光伏农业有哪些:kw->光伏农业:kws->光伏农业,光伏板,光伏行业
searchES-TimeMillisSpent:282
16213@f:currentT->http-nio-8080-exec-14:t->内蒙古正规自卸车淋水器配件哪家好:kw->自卸车淋水器配件:kws->自卸车淋水器配件,货车淋水器,自卸车淋水器封头

Apache Tomcat 7 Configuration Reference (7.0.92) - The HTTP Connectorhttps://tomcat.apache.org/tomcat-7.0-doc/config/http.html#Standard_Implementation
minSpareThreads

The minimum number of threads always kept running. This includes both active and idle threads. If not specified, the default of 10 is used. If an executor is associated with this connector, this attribute is ignored as the connector will execute tasks using the executor rather than an internal thread pool. Note that if an executor is configured any value set for this attribute will be recorded correctly but it will be reported (e.g. via JMX) as -1 to make clear that it is not used.


@RequestMapping(value = "/getESversion553ByPost", method = RequestMethod.POST)
public ResponseEntity getES653(@RequestBody TitleKeyword titleKeyword) throws IOException {
long startMethod = System.currentTimeMillis();
long searchESTimeMillisSpent = 0;
String title = titleKeyword.getTitle();
String keyword = titleKeyword.getKeyword();
String keywords = titleKeyword.getKeywords();
String searchESstr;
String resJsonStr;
JSONObject jsonObject;
HttpStatus httpStatus = HttpStatus.OK;
String kwsSeparatorStr = ","; // TODO searchESstr公共部分摘除
// 假设优先级 主关键词>关键词列表>标题,有关键词存在情况下,不考虑标题
if (keyword != null && keyword.replace(" ", "").length() > 0) {
if (keywords != null && keywords.replace(" ", "").length() > 0) {
if (keywords.contains(kwsSeparatorStr)) {
String[] requestKeywordList = keywords.split(kwsSeparatorStr);
// TODO 此处需要结合es数据结构请求的数据结构进行算法优化,使得es搜索结果精准
keywords = keyword + "," + requestKeywordList[0] + "," + requestKeywordList[requestKeywordList.length - 1];
} else {
keywords = keyword + "," + keywords;
}
} else {
keywords = keyword;
}
searchESstr = "{\"from\":0,\"size\":200,\"query\":{\"bool\":{\"should\":[{\"match\":{\"keyword\":{\"query\":\"" + keyword + "\",\"boost\":2}}},{\"match\":{\"text\":{\"query\":\"" + keywords + "\",\"boost\":1}}}]}},\"track_scores\":\"true\",\"sort\":[{\"weight\":{\"order\":\"desc\"}},{\"_score\":{\"order\":\"desc\"}}]}";
} else if (title != null && title.replace(" ", "").length() > 0) {
searchESstr = "{\"from\":0,\"size\":200,\"query\":{\"bool\":{\"should\":{\"match\":{\"text\":{\"query\":\"" + title + "\"}}}}},\"track_scores\":\"true\",\"sort\":[{\"weight\":{\"order\":\"desc\"}},{\"_score\":{\"order\":\"desc\"}}]}";
} else {
// TODO 同上
searchESstr = "";
} if (searchESstr == "") {
resJsonStr = "{\"msg\":\"请求参数非法!BAD_REQUEST!\"}";
} else {
final CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
long timeMillisSpent = 0;
long startEsSearch = System.currentTimeMillis();
long endEsSearch;
// TODO 硬代码
credentialsProvider.setCredentials(AuthScope.ANY,
new UsernamePasswordCredentials("elastic", "admi"));
RestClient restClient = RestClient.builder(new HttpHost("es-cn-m3ats.elasticsearch.aliyuncs.com", 9200))
.setHttpClientConfigCallback(new RestClientBuilder.HttpClientConfigCallback() {
@Override
public HttpAsyncClientBuilder customizeHttpClient(HttpAsyncClientBuilder httpClientBuilder) {
return httpClientBuilder.setDefaultCredentialsProvider(credentialsProvider);
}
}).build();
try {
HttpEntity httpEntity = new StringEntity(searchESstr, ContentType.APPLICATION_JSON);
//search a document
String endpoint = "/search_text/_search?";
Response response = restClient.performRequest("GET", endpoint,
Collections.singletonMap("pretty", "false"), httpEntity);
endEsSearch = System.currentTimeMillis();
searchESTimeMillisSpent = endEsSearch - startEsSearch;
resJsonStr = EntityUtils.toString(response.getEntity());
} catch (IOException e) {
e.printStackTrace();
resJsonStr = "{\"msg\":\"" + e.toString() + "\"}";
httpStatus = HttpStatus.REQUEST_TIMEOUT;
} finally {
credentialsProvider.clear();
restClient.close();
}
}
Thread t = Thread.currentThread();
String debug = ManagementFactory.getRuntimeMXBean().getName() + ":currentT->" + t.getName() + ":t->" + title + ":kw->" + keyword + ":kws->" + keywords;
jsonObject = JSONObject.parseObject(resJsonStr);
long beforeReturn = System.currentTimeMillis();
System.out.println("searchES:" + searchESTimeMillisSpent + "inMethod2BeforeReturn:" + (beforeReturn - startMethod) + "thread:" + debug);
return new ResponseEntity<JSONObject>(jsonObject, httpStatus);
}  java -jar target/springMybatis-1.0-SNAPSHOT.jar -Xms2g -Xmx2g 对接口发起百次请求,统计区间断点时间、最值时间、平均值时间
												

spring boot tomcat 线程数 修改初始线程数 统计性能 每百次请求耗时的更多相关文章

  1. spring cloud spring boot JPA 克隆对象修改属性后 无法正常的执行save方法进行保存或者更新

    2019-12-1220:34:58 spring cloud spring boot JPA 克隆对象修改属性后 无法正常的执行save方法进行保存或者更新 未解决

  2. Spring boot中最大连接数、最大线程数与最大等待数在生产中的异常场景

    在上周三下午时,客户.业务和测试人员同时反溃生产环境登录进入不了系统,我亲自测试时,第一次登录进去了,待退出后再登录时,复现了客户的问题,场景像是请求连接被拒绝了,分析后判断是spring boot的 ...

  3. Spring Boot tomcat

    定制内嵌 Tomcat 设置内嵌Tomcat的端口 Spring Boot 内嵌的 Tomcat 服务器默认运行在 8080 端口.如果,我们需要修改Tomcat的端口,我们可以在 src/main/ ...

  4. 如何配置Spring Boot Tomcat

    1.概述 Spring Boot Web应用程序默认包含预配置的嵌入式Web服务器.但在某些情况下,我们要修改默认配置以满足自定义要求. 在本教程中,我们将介绍通过application.proper ...

  5. spring boot tomcat 打本地包成war,通过Tomcat启动时出现问题: ZipException: error in opening zip file

    一个第三方公司提供spring boot 项目,直接启动是ok的, 但是打包成war,通过Tomcat启动,就出现 ZipException: error in opening zip file: 2 ...

  6. Spring Boot Tomcat配置详解

    参数配置容器 server.xx开头的是所有servlet容器通用的配置,server.tomcat.xx开头的是tomcat特有的参数,其它类似. 所有参数绑定配置类:org.springframe ...

  7. 【spring boot】spring boot的自定义banner修改+spring boot启动项目图标修改

    1.启动Spring Boot项目后会看到这样的图案,这个图片其实是可以自定义的,打开网站 http://patorjk.com/software/taag/#p=display&h=3&am ...

  8. spring boot tomcat 部署

    前几天springboot项目部署到linux中,整个过程就是个坑啊.踩坑的过程中也学到了许多.spring boot 项目部署时由于其内置了tomcat和jdk,而且还都是8. 所以部署的话就分为两 ...

  9. Spring Boot入门(12)实现页面访问量统计功能

      在日常的网站使用中,经常会碰到页面的访问量(或者访问者人数)统计.那么,在Spring Boot中该如何实现这个功能呢?   我们的想法是比较简单的,那就是将访问量储存在某个地方,要用的时候取出来 ...

随机推荐

  1. Fastqc 能够识别的碱基编码格式

    Fastqc 能够自动识别序列的碱基编码格式,我查看一下源代码,发现是碱基编码格式一共分为 1)sanger/illumina 1.9 2) illumina 1.3 3) illumina 1.5 ...

  2. CentOS服务器上搭建Gitlab安装步骤、中文汉化详细步骤、日常管理以及异常故障排查

    一, 服务器快速搭建gitlab方法 可以参考gitlab中文社区 的教程centos7安装gitlab:https://www.gitlab.cc/downloads/#centos7centos6 ...

  3. js中数组作为参数传递的定义

    下面的函数实现了一个我们想要的最基本的图片预加载效果 function preloadimages(arr){    var newimages=[]    var arr=(typeof arr!= ...

  4. SQL中查询语句的使用

    常用SQL查询语句 - myLittleGarden - 博客园 http://www.cnblogs.com/sunada2005/p/3411873.html 一.简单查询语句 1. 查看表结构 ...

  5. 左连接去重(objec)

    需求场景: 1.前端使用的object-table(angularJs) 2.自定义模糊查询 可以模糊查询主表,主表没有数据的时候,可通过字表的(name或者hostname)字段来查询(主-子:一对 ...

  6. 倾斜摄影 实景三维建模软件photoscan教程

    PhotoScan是一款基于影响自动生成高质量实景三维模型的优秀软件,这对于3D建模需求来说实在是一把利器. PhotoScan无需设置初始值,无须相机检校,它根据最新的多视图三维重建技术,可对任意照 ...

  7. Phpcms v9专题分类增加模板设置的方法

    Phpcms v9专题设置里面,默认专题子分类是无模板设置的,本文教你通过官方论坛给出的教程实现专题分类增加模板设置.先来看看默认专题子分类设置界面: 修改后的的专题子分类设置界面多了模板设置: 修改 ...

  8. 面向对象----构造方法、this 关键字、函数的参数传递、package语句/import语句

    构造方法 构造器的定义.作用 构造方法的特征 它具有与类相同的名称:它不含返回值: 注意:在构造方法里不含返回值的概念是不同于“void”的,在定义构造方法时加了“void”,结果这个方法就不再被自动 ...

  9. swift - UITextView的用法

    1,多行文本控件的创建 textView.frame = CGRect(x:50,y:180,width:self.view.bounds.size.width - 100,height:50) te ...

  10. Unity官网针对IOS开发有比较好的建议

    Unity官网针对IOS开发有比较好的建议,我总结了翻译如下,后面附上原文. 尽量控制定点数量(注意所谓顶点不是建模时的顶点,而是引擎渲染时的顶点.例如,模型一个顶点如果设置了2个法向,那么对引擎来说 ...