[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. 使用ffmpeg获取视频流后如何封装存储成mp4文件

    int main(int argc,char *argv[]) 02 { 03  AVFormatContext *pFormatCtx; 04  int i,videoStream; 05  AVC ...

  2. mysql -- 模糊查询的四种方法

    摘录自:http://www.jb51.net/article/48315.htm 1 %:表示任意0个或多个字符.可匹配任意类型和长度的字符,有些情况下若是中文,请使用两个百分号(%%)表示. 比如 ...

  3. VNC轻松连接远程Linux桌面(1)

    Linux平台安装VNCServer Windows平台使用VNC-Viewer 方法/步骤     在Linux平台安装VNCServer服务端软件包. #yum -y install vnc *v ...

  4. linux定时任务cron 安装配置

    名词解释: cron是服务名称,crond是后台进程,crontab则是定制好的计划任务表. 软件包安装: 要使用cron服务,先要安装vixie-cron软件包和crontabs软件包,两个软件包作 ...

  5. Java中的各种加密算法

    Java中为我们提供了丰富的加密技术,可以基本的分为单向加密和非对称加密 1.单向加密算法 单向加密算法主要用来验证数据传输的过程中,是否被篡改过. BASE64 严格地说,属于编码格式,而非加密算法 ...

  6. Linux mysqladmin 命令

    mysqladmin命令可以用来设置或修改 MySQL 密码,常见用法如下: [root@localhost ~]$ mysqladmin -uroot password 'newPass' # 在无 ...

  7. kubectl get 输出格式

    常见的输出格式有: * custom-columns=<spec> # 根据自定义列名进行输出,逗号分隔 * custom-columns-file=<filename> # ...

  8. exp/imp与expdp/impdp区别

    在平常备库和数据库迁移的时候,当遇到大的数据库的时候在用exp的时候往往是需要好几个小时,耗费大量时间.oracle10g以后可以用expdp来导出数据库花费的时间要远小于exp花费的时间,而且文件也 ...

  9. 使用HTML5 的跨域通信机制进行数据同步

    离线应用系统的设计目标就是在网络离线情况下依然可以操作我们的应用系统,并在网络畅通的情况下与服务器进行数据交互. 所以离线应用系统最终会做成类似C/S架构的客户端应用程序.这边基于Chrome或者 S ...

  10. 微信小程序实现文字跑马灯

    wxml: <view>1 显示完后再显示</view> <view class="example"> <view class=" ...