[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. 科技发烧友之3d吉米投影

    http://item.jd.com/1558081.html?r=1434635270480#comment 暴风199的墨镜

  2. css -- 通俗理解inline、block、inline-block

    display:inline; 内联元素,简单来说就是在同一行显示. display:block; 块级元素,简单来说就是就是有换行,会换到第二行. display:inline-block; 就是在 ...

  3. QListView的子项的ViewMode

    QListView.setViewMode(ViewMode mode) enum QListView::ViewMode Constant    Value    DescriptionQListV ...

  4. 【Java面试题】31 介绍Collection框架的结构

    Collection:List列表,Set集 Map:Hashtable,HashMap,TreeMap   Collection  是单列集合 List   元素是有序的.可重复 有序的 colle ...

  5. 搭建Hadoop伪分布式时遇到的各种错

    1.本地连接远端用户没有权限 2.执行时提示,保存三分数据,但是只有一个节点是活的 问题1解决办法:在hdfs-site.xml文件中添加一下配置(是否在HDFS中开启权限检查) <proper ...

  6. Vuforia AR实战教程

    官网:https://developer.vuforia.com/ Vuforia AR实战教程 http://www.taikr.com/my/course/531. AQaVpF//////AAA ...

  7. Unity战斗系统之AI自主决策

    http://www.taikr.com/course/448/tasks http://www.xuanyusong.com/archives/1840 http://www.cnblogs.com ...

  8. 解决导入protobuf源代码Unity报错的问题

    将源代码导入Assets目录后, unity引擎会出现以下报错: 解决办法: 在 unity项目Assets目录中创建smcs.rsp文件,内容为-unsafe,其作用为可编译不安全代码.     然 ...

  9. Canny边缘检测——学习笔记

    Sobel Canny 非极大值抑制NMS,上表为角度,下表为灰度 26度,在0-45°之间,离45°更近. 把不是极大值的点改为0,这样边缘会细很多. 双阈值判定 深度优先遍历

  10. C/C++ 头文件以及库的搜索路径

    关键点: 1. #include <...> 不会搜索当前目录 2. 使用 -I 参数指定的头文件路径仅次于 搜索当前路径. 3. gcc -E -v 可以输出头文件路径搜索过程 C++编 ...