当前位置:网站首页>【大型电商项目开发】性能压测-优化-中间件对性能的影响-40
【大型电商项目开发】性能压测-优化-中间件对性能的影响-40
2022-07-05 00:59:00 【随意石光】
一:测试nginx对性能的影响
1.打开jmeter进行测试

- 将线程数修改为50,并且勾中永远,让其一直测试,除非手动停止
2.给nginx发送请求
给服务器的80端口发送请求,并添加如下汇总图
- 使用
docker stats查看docker容器使用情况
结论:nginx需要给其他服务频繁转发,所以使用消耗的线程多,内存小,cpu占用空间大
二:监控指标
1、中间件指标

- 当前正在运行的线程数不能超过设定的最大值。一般情况下系统性能较好的情况下,线 程数最小值设置 50 和最大值设置 200 比较合适。
- 当前运行的 JDBC 连接数不能超过设定的最大值。一般情况下系统性能较好的情况下, JDBC 最小值设置 50 和最大值设置 200 比较合适。
- GC频率不能频繁,特别是 FULL GC 更不能频繁,一般情况下系统性能较好的情况下, JVM 最小堆大小和最大堆大小分别设置 1024M 比较合适。
2、数据库指标

- SQL 耗时越小越好,一般情况下微秒级别。
- 命中率越高越好,一般情况下不能低于 95%。
- 锁等待次数越低越好,等待时间越短越好。
3、联合测试


- 中间件越多,性能损失越大,大多都损失在网络交互了;
- 业务:
Db(MySQL 优化)
模板的渲染速度(缓存)
静态资源
三:优化吞吐量
1.nginx实现动静分离
1)以后所有的静态资源都放在nginx里面
2)规则:/static/***所有请求都由nginx直接返回
3)搬家静态资源(将静态资源直接转移到服务器里面)
- 进入到HTML路径下
cd /mydata/nginx/html - 在HTML下新建static
mkdir static - 进入到static文件夹,并且将product的静态资源index复制进去(将本项目的静态资源删除)
- 在img,src,herf标签中加入/static/路径

2.修改服务器nginx的配置
1)进入到cd /mydata/nginx/conf/conf.d路径下
2)修改gulimail.conf文件 vi gulimail.conf
location /static/ {
root /usr/share/nginx/html;
}
边栏推荐
- [circuit design] optocoupler use and circuit design summary
- 揭露测试外包公司,关于外包,你或许听到过这样的声音
- dotnet-exec 0.6.0 released
- Analysis and comparison of leetcode weekly race + acwing weekly race (t4/t3)
- Implementation steps of master detail detail layout mode of SAP ui5 application
- [FPGA tutorial case 9] design and implementation of clock manager based on vivado core
- Single step debugging of master data reading of SAP commerce cloud products
- Mongodb series learning notes tutorial summary
- [pure tone hearing test] pure tone hearing test system based on MATLAB
- 26.2 billion! These universities in Guangdong Province have received heavy support
猜你喜欢

Detailed explanation of openharmony resource management

华为百万聘请数据治理专家!背后的千亿市场值得关注

I was beaten by the interviewer because I didn't understand the sorting

7. Scala process control

BGP comprehensive experiment
![Pandora IOT development board learning (RT thread) - Experiment 4 buzzer + motor experiment [key external interrupt] (learning notes)](/img/ad/5fbf8c3f71ea204bcd48473c3811f6.png)
Pandora IOT development board learning (RT thread) - Experiment 4 buzzer + motor experiment [key external interrupt] (learning notes)

1189. Maximum number of "balloons"

Apifox (postman + swagger + mock + JMeter), an artifact of full stack development and efficiency improvement

【海浪建模1】海浪建模的理论分析和matlab仿真

Huawei employs data management experts with an annual salary of 2million! The 100 billion market behind it deserves attention
随机推荐
26.2 billion! These universities in Guangdong Province have received heavy support
const、volatile和restrict的作用和用法总结
Senior Test / development programmers write no bugs? Qualifications (shackles) don't be afraid of mistakes
lambda expressions
Maximum number of "balloons"
Mongodb series learning notes tutorial summary
ORB(Oriented FAST and Rotated BRIEF)
skimage: imread & imsave & imshow
资深测试/开发程序员写下无bug?资历(枷锁)不要惧怕错误......
Huawei employs millions of data governance experts! The 100 billion market behind it deserves attention
[wave modeling 1] theoretical analysis and MATLAB simulation of wave modeling
Daily practice (18): stack containing min function
Paper notes multi UAV collaborative monolithic slam
"Upside down salary", "equal replacement of graduates" these phenomena show that the testing industry has
Digital DP template
SAP UI5 应用开发教程之一百零七 - SAP UI5 OverflowToolbar 容器控件介绍的试读版
Open3d uses GICP to register point clouds
MySQL uses the explain tool to view the execution plan
GDB common commands
107. Some details of SAP ui5 overflow toolbar container control and resize event processing