转发文章赚钱的网站建设,网站建设和网络推广外包,杭州网站设计费用,搜索引擎优化名词解释性能测试文档
背景
为对产品性能有一定了解#xff0c;现将产品展开一次性能测试#xff1b;
环境与工具
本章为基本工具准备及linux命令说明#xff0c;无先后顺序。
Xshell工具
本文使用Xshell在Windows界面下远程登录linux主机安装Xshell直接全部选择默认选项即可现将产品展开一次性能测试
环境与工具
本章为基本工具准备及linux命令说明无先后顺序。
Xshell工具
本文使用Xshell在Windows界面下远程登录linux主机安装Xshell直接全部选择默认选项即可安装包见发货包\辅助工具\新建会话以主机为例 点击新建按钮 填写会话名称linux主机ip地址 点击确定 双击新建立的会话 输入用户名 输入密码 成功登录 winSCP工具
本文使用winSCP将Windows下的文件上传到Linux系统中安装winSCP直接全部选择默认选项即可安装包见发货包\辅助工具\以普通用户登录只能向个人目录上传文件以root用户登录可以向任意路径上传文件建议管理员以root用户登陆。新建会话以主机为例
点击新建会话 选择新建站点写入linux主机ip、用户名、密码点击登录即可 如下所示登陆成功 其中左侧为windows本地文件右侧为linux系统文件 上传文件拖动即可下图为将windows E:\soft\test文件夹上传到linux系统/home/rs10user路径下
Jemte工具 用例与脚本
系统登录
实验
脚本录制与制作
(156条消息) JMeter脚本录制-快速上手篇_jmeter录制_软件测试大叔的博客-CSDN博客 或使用手工添加
Jmeter使用
正在上传…重新上传取消
点击1清理后点击2执行
测试与性能指标
Tps响应时间错误率 相关策略与问题解决
改过 author 的feign 超时时间删掉所有日志author与sys pod 比为2:5 4:12ClientAbortException: java.io.IOException: Broken pipe 解决
https://blog.csdn.net/Beyondpyj/article/details/115730750
查看物理机 连接数 netstat -n | awk /^tcp/ {S[$NF]} END {for(a in S) print a, S[a]} 增大druid连接数据最小连接数3和最大连接数400初始连接数50增大数据库最大连接数为 500Nginx配置超时 # backend server proxy location /gateway/ { proxy_pass http://192.168.168.205:30130/; #proxy_set_header Host $http_host; ##转发后端口别忘了 proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header HTTP_X_FORWARDED_FOR $remote_addr; ##关键句 proxy_set_header X-Forwarded-Proto $scheme; proxy_redirect default; --- proxy_connect_timeout 60000s; ## proxy_send_timeout 180s; proxy_read_timeout 180s; proxy_buffer_size 1M; proxy_buffers 8 1M; proxy_busy_buffers_size 1M; proxy_temp_file_write_size 1M; } 代理商环境的一些配置 ip 作用 cpu memory
192.168.7.100 master 2 8
192.168.7.101 master
192.168.7.102 worker 4 16
192.168.7.103 worker
192.168.7.104 manager 4 24 linux 查cpu 核数 cat /proc/ cpu info | grep processor | wc -llinux 查内存 free -mlinux 查cpu内存 使用率 top 500账户查询
消除 oderby 后面的 dep_name
sys_acct_type 添加索引 act_type
sys2300,2400加入白名单
修改2300 2400 程序 因为数据库是Windows的机器这次我们报告内就不体现资源占用情况了这个问题您后期可以再去优化一下我们这次测试主抓耗时和报错率。 cat logs-from-business-sys-in-business-sys-7577b48fcb-b6gn6.txt |grep gridpanel total时间|awk -F: {print $4} jemete 聚合报告参数含义
https://blog.csdn.net/m0_72875584/article/details/128883344 plsql执行计划
https://www.cnblogs.com/kiamer2425/p/14968523.html 使用topic 命令查看容器中性能 nginx中添加了 时间日志
/etc # cat /etc/nginx/nginx.conf user nginx;
worker_processes auto; error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid; events { worker_connections 1024;
} http { include /etc/nginx/mime.types; default_type application/octet-stream; log_format main $remote_addr - $remote_user [$time_local] $request $status $body_bytes_sent $http_referer $http_user_agent $http_x_forwarded_for $request_time $upstream_response_time; access_log /var/log/nginx/access.log main; sendfile on; #tcp_nopush on; keepalive_timeout 65; #gzip on; include /etc/nginx/conf.d/*.conf;
}
Windows机器tcp连接数增大
(152条消息) jmeter压力测试(踩坑)报错:java.net.BindException: Address already in use: connect_能白话的程序员♫的博客-CSDN博客 Nginx里时长配置
实验是将mrp 默认使用nodePort 端口
正在上传…重新上传取消
正在上传…重新上传取消
服务器超时配置
import org.apache.catalina.connector.Connector; import org.apache.coyote.http11.Http11NioProtocol; import org.springframework.boot.web.embedded.tomcat.TomcatConnectorCustomizer; import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory; import org.springframework.boot.web.server.ConfigurableWebServerFactory; import org.springframework.boot.web.server.WebServerFactoryCustomizer; import org.springframework.stereotype.Component;//设置超时时间//当Spring容器中没有TomcatEmbeddedServletContainerFactory这个bean时会把此bean加载进容器Componentpublic class WebServerConfiguration implements WebServerFactoryCustomizerConfigurableWebServerFactory { Override public void customize(ConfigurableWebServerFactory factory) { //使用工厂类定制tomcat connector ((TomcatServletWebServerFactory) factory).addConnectorCustomizers(new TomcatConnectorCustomizer() { Override public void customize(Connector connector) { Http11NioProtocol protocol (Http11NioProtocol) connector.getProtocolHandler(); //设置15秒无响应则断开keepalive protocol.setKeepAliveTimeout(1500000000); //设置最大n次请求后则断开keepalive, -1表示无穷 protocol.setMaxKeepAliveRequests(-1); } }); } }
正在上传…重新上传取消 正在上传…重新上传取消 Oracle 连接最大5000Nginx最大请求书12000
server: tomcat: max-threads: 1000 accpt-count: 500 connection-timeout: 2000000000 servlet: session: timeout: 2000000000
最后实践中没有加 connecton-timeoute 和 session.timeout 也可以。需要再尝试 todo 1683784604409,101,查账户,Non HTTP response code: java.net.NoRouteToHostException,Non HTTP response message: Cannot assign requested address (Address not available),Thread Group 1-9377,text,false,,1995,0,9968,9968,http://192.168.168.205:30132/sys/sys0000/rsacct/get_c?companyCode01acctCodeceshi59,0,0,0
(153条消息) jmeter java.net.NoRouteToHostException: Cannot assign requested address (Address not available)_jmeter noroutetohostexception_zhangzhen02的博客-CSDN博客 进一步增大sys的核数 到达8c2g8c 2g 8pod
达到 正在上传…重新上传取消 正在上传…重新上传取消 报错 没有java_home . 使用命令 source /etc/profile ; Gateway*1 0.5c1.6G author*1 4c4g 100人并发tps 113时间0.895s,错误率0Gateway*1 0.5c1.6G author*1 4c4g 200人并发tps 108时间1.824s错误率0Gateway*1 0.5c1.6G author*2 4c4g 200人并发tps 221时间0.894s错误率0Gateway*1 2 c2G author*3 28c8g 1000人并发tps 291时间2.834s错误率0记录author 服务消耗 CPU
正在上传…重新上传取消 附录
jMeter 安装插件
(157条消息) 【JMeter】插件安装_jmeter插件安装_段小王爷的博客-CSDN博客
jMeter常见错误
(154条消息) 记录jmeter使用时遇到的错误Non HTTP response code: org.apache.http.NoHttpResponseException_uling94的博客-CSDN博客
Jmeter 各个参数意义
Jmeter的Linux单机压测_AMEI_2015的博客-CSDN博客
(152条消息) JMeter聚合报告的参数含义__jone的博客-CSDN博客 jmeter -n -t xhsxportal.jmx -l result.jtl
Creating summariser summary
Created the tree successfully using xhsxportal.jmx
Starting the test Tue Dec 27 18:44:02 CST 2016 (1482835442042)
Waiting for possible shutdown message on port 4445
summary 1 in 0.3s 3.2/s Avg: 68 Min: 68 Max: 68 Err: 0 (0.00%) Active: 3 Started: 3 Finished: 0
summary 479387 in 28s 17377.9/s Avg: 0 Min: 0 Max: 68 Err: 0 (0.00%) Active: 10 Started: 10 Finished: 0
summary 479388 in 28s 17185.4/s Avg: 0 Min: 0 Max: 68 Err: 0 (0.00%)
summary 39106 in 2.1s 18273.8/s Avg: 0 Min: 0 Max: 39 Err: 0 (0.00%) Active: 0 Started: 10 Finished: 10
summary 518494 in 30s 17263.0/s Avg: 0 Min: 0 Max: 68 Err: 0 (0.00%)
Tidying up ... Tue Dec 27 18:44:32 CST 2016 (1482835472140)
... end of run 这里只设置了10个并发测试。28s是最近28秒内的平均TPS Avg是平均响应时间Max是最大响应时间Err是错误率Active是目前活跃的并发数。 Label----每个请求的名称比如HTTP请求等 #Samples----发给服务器的请求数量 Average----单个请求的平均响应时间 毫秒ms Median----50%请求的响应时间 毫秒ms 90%Line----90%请求响应时间 毫秒ms 95%Line----95%请求响应时间 毫秒ms 99%Line----99%请求的响应时间 毫秒ms Min----最小的响应时间 毫秒ms Max----最大的响应时间 毫秒ms Error%----错误率错误的请求的数量/请求的总数 Throughput----吞吐量即表示每秒完成的请求数 Received KB/sec----每秒从服务器端接收到的数据量 Sent KB/sec----每秒从客户端发送的请求的数量
Jmeter之性能测试TPS解析 (152条消息) Jmeter之性能测试TPS解析_jmeter tps_林渊羡鱼的博客-CSDN博客
(154条消息) 【jmeter】监听器吞吐量与平均响应时间详解_jmeter查看平均响应时间_山河不见老的博客-CSDN博客
Linxu环境测试报告
(152条消息) Linux环境运行jmeter测试报告查看_linux 查看jmeter 聚合报告_Bruce小鬼的博客-CSDN博客.
查看结果书
(153条消息) Jmeter察看结果树将测试结果保存本地_jmeter查看文件保存位置_weeds606的博客-CSDN博客
理解tips
【jmeter】监听器吞吐量与平均响应时间详解_jmeter查看平均响应时间_山河不见老的博客-CSDN博客
cpu占用过高
Docker 容器内分析 java程序占用 cpu 高问题排查分析-腾讯云开发者社区-腾讯云 (tencent.com)
服务器与并发量
服务器一般几核够用-羊毛之家 (yangmao.info)
正在上传…重新上传取消
使用这个docker 镜像含有jdk
openjdk-8u111-jdk
Docker
一些用到的linux命令
top
jstack 6 a.txt 信息到a.txt
ps aux
Docker 命令 # 加载本地镜像到docker里
docker load alpine-oraclejre8-8.202.08-full.tar
#监控docker容器中使用率
docker stats 容器id
# 拷贝容器中文件到本目录
docker cp 13ab29a61863:/a3.txt .
VisualVm远程监控
利用VisualVm和JMX远程监控K8S里的Java进程 - UCloud云社区
利用VisualVm和JMX远程监控K8S里的Java进程 - 颇忒脱 - SegmentFault 思否
JStack
docker查看那个java程序cpu使用率100% - 大海全是 - 博客园 (cnblogs.com)
(154条消息) docker 分析cpu占用过高_docker容器cpu过高_打包爱的博客-CSDN博客
Java程序占用 CPU 过高排查方法 - 简书 (jianshu.com)
Tomcat 线程数
(153条消息) Tomcat线程数、连接数相关配置_tomcat连接数_爱琴孩的博客-CSDN博客
Ngixn 日志配置
nginx 日志log_format - sucre_tan - 博客园 (cnblogs.com)
nginx日志配置log_format (hebinghua.com) (152条消息) Nginx配置中的log_format_nginx log_format_兴乐安宁的博客-CSDN博客 Springboot nginx响应超时
(152条消息) Springboot调整接口响应返回时长解决响应超时问题_springboot设置接口超时时间_JermeryBesian的博客-CSDN博客 Jemter录制脚本 (156条消息) JMeter脚本录制-快速上手篇_jmeter录制_软件测试大叔的博客-CSDN博客
使用jprofiler查看检查代码 https://blog.csdn.net/vicky_pyh/article/details/88797514 统计linxu 网路流量
在Linux下怎么看网络流量_系统运维_内存溢出 (outofmemory.cn)
sar -n DEV 1 4 K8s中内存资源限制介绍
(152条消息) kubernetes(k8s)容器资源限制内存限制、cpu限制、namespace限制_k8s 内存限制_鲸鱼妹子的博客-CSDN博客