SlideShare a Scribd company logo
1 of 21
探讨web优化 开发二部:  陆松林
目录 Web服务的过程 服务器并发 实践方法、常见瓶颈 案例 小结
(一)Web服务的过程 web请求 服务 过程图
(一)Web服务的过程 请求步骤: 1.浏览器发起一个请求,本地是否有缓存 2.浏览器真实发起请求服务器时   3.系统层再把连接交给你的server做处理 4. server再把数据交给你的程序处理 5.程序对数据库、缓存处理 6.数据返回给用户 7.用户下次访问
(一)Web服务的过程 web请求时间结构图
(二)服务器并发 服务器请求处理结构图
(二)服务器并发 什么是web服务器? 就作连接、处理和断开三件事 WEB服务器,读取位于网卡的接收缓冲区中,封装在IP包中服务器的请求,然后进行处理,并将结果写到发送缓冲区。
(二)服务器并发 CPU 并发计算 服务器并发 概念点 持久连接 吞吐率 I/O模型
(二)服务器并发 服务器并发策略 一个进程处理一个连接,非阻塞I/O   (fork和prefork) 一个线程处理一个连接,非阻塞I/O  (apahce的worker) 一个进程处理多个连接,非阻塞I/O    (nginxworker_process) 一个线程处理多个连接,异步I/O  (Lighttpd1.5)
(二)服务器并发 服务配置参数示例
(二)服务器并发 线上示例1
(二)服务器并发 线上示例2 代理服务器top图
现象清单,取有效数据 防止过度性能优化设计,投入产出比 分析数据总结规律,找到拐点 加入探针,验证结论 制订计划,非常详细的目标 1 4 5 3 3 2 (三)实践方法、常见瓶颈
(三)实践方法、常见瓶颈 对资源消耗不多, 但程序执行慢的情况 CPU消耗分析 服 务 器 瓶 颈 程序执行慢的原因 文件IO消耗分析 内存消耗分析 网络IO消耗分析 其它
(四)案例 博客弱请求案例 背景介绍….. ,[object Object],平时跑动正常,服务器运行稳定。 不定期无规律负载高,打开页面特慢,严重时的个别可能502
(四)案例 博客弱请求案例 ,[object Object],修改nginx配置文件,在log_format最后面,添加$request_time tail -fn100 /usr/local/nginx/logs/access.log cat access.log |awk  '($7~/html/){print $NF " " $1 " " $4 " " $7}'|sort -nr|head -100
(四)案例 博客弱请求案例 ,[object Object],方法一:      分析这个请求对应的程序是不是有很多for循环,是不是直接读库,缓存策略是否还可以优化等等修改程序就OK。 方法二:      利用nginx的正则匹配转发,我们把这些弱请求统计转到其它服务器处理,起到分流的作用。
(五)小结 我们作优化工作的目的是什么: A. 增加应用吞吐量,减少网络和应用服务器的投入 B. 用户体验方面的提升,如响应速度,单个请求的响时间 分析入口或评判指标: 1. 系统的整个请求容量  2. 单个请求的响时间
(五)小结 请求优化 小结
(五)小结
探讨Web优化

More Related Content

Viewers also liked

Customer accomodation.report
Customer accomodation.reportCustomer accomodation.report
Customer accomodation.reportArman Jayson
 
Loyalty and customer focus tena
Loyalty and customer focus tenaLoyalty and customer focus tena
Loyalty and customer focus tenaJorge Wise
 
Näringslivsdagen 2010. Jarnheimer customer focus eng
Näringslivsdagen 2010. Jarnheimer customer focus engNäringslivsdagen 2010. Jarnheimer customer focus eng
Näringslivsdagen 2010. Jarnheimer customer focus engÅlands Näringsliv
 
Total Customer Focus: Changing customer relationships where it matters most
Total Customer Focus: Changing customer relationships where it matters mostTotal Customer Focus: Changing customer relationships where it matters most
Total Customer Focus: Changing customer relationships where it matters mostGlobal Partners Inc.
 
RELANTIONSHIP MARKETING As A TOOL
RELANTIONSHIP MARKETING As A TOOL RELANTIONSHIP MARKETING As A TOOL
RELANTIONSHIP MARKETING As A TOOL Amarnath Krishnan
 
Relationship marketing
Relationship marketingRelationship marketing
Relationship marketingKira_Lio
 
Customer focus and relationship management
Customer focus and relationship managementCustomer focus and relationship management
Customer focus and relationship managementUday Koganti
 
10 Habits of Successful Creative People: How to change your mind and build cr...
10 Habits of Successful Creative People: How to change your mind and build cr...10 Habits of Successful Creative People: How to change your mind and build cr...
10 Habits of Successful Creative People: How to change your mind and build cr...Yuan Wang
 
Relationship marketing
Relationship  marketingRelationship  marketing
Relationship marketingNaveen Prasad
 
Brochura lidando com dramas familiares Igreja do Nazareno
Brochura lidando com dramas familiares   Igreja do Nazareno Brochura lidando com dramas familiares   Igreja do Nazareno
Brochura lidando com dramas familiares Igreja do Nazareno Jose Heleno Gomes Pereira
 
Frokostmøte 27.okt - Tom Martin Kj. Hartviksen, Ola Alsterholm, Hans Martin N...
Frokostmøte 27.okt - Tom Martin Kj. Hartviksen, Ola Alsterholm, Hans Martin N...Frokostmøte 27.okt - Tom Martin Kj. Hartviksen, Ola Alsterholm, Hans Martin N...
Frokostmøte 27.okt - Tom Martin Kj. Hartviksen, Ola Alsterholm, Hans Martin N...Destinasjon Trysil
 
Een onderzoek naar gefailleerde herstarters in vlaanderen
Een onderzoek naar gefailleerde herstarters in vlaanderenEen onderzoek naar gefailleerde herstarters in vlaanderen
Een onderzoek naar gefailleerde herstarters in vlaanderenBouckaert
 

Viewers also liked (20)

Presentació anglès
Presentació anglèsPresentació anglès
Presentació anglès
 
Customer accomodation.report
Customer accomodation.reportCustomer accomodation.report
Customer accomodation.report
 
Loyalty and customer focus tena
Loyalty and customer focus tenaLoyalty and customer focus tena
Loyalty and customer focus tena
 
Näringslivsdagen 2010. Jarnheimer customer focus eng
Näringslivsdagen 2010. Jarnheimer customer focus engNäringslivsdagen 2010. Jarnheimer customer focus eng
Näringslivsdagen 2010. Jarnheimer customer focus eng
 
Mentorskap företagarskolan
Mentorskap   företagarskolanMentorskap   företagarskolan
Mentorskap företagarskolan
 
Total Customer Focus: Changing customer relationships where it matters most
Total Customer Focus: Changing customer relationships where it matters mostTotal Customer Focus: Changing customer relationships where it matters most
Total Customer Focus: Changing customer relationships where it matters most
 
Customer Focus
Customer FocusCustomer Focus
Customer Focus
 
RELANTIONSHIP MARKETING As A TOOL
RELANTIONSHIP MARKETING As A TOOL RELANTIONSHIP MARKETING As A TOOL
RELANTIONSHIP MARKETING As A TOOL
 
Relationship marketing
Relationship marketingRelationship marketing
Relationship marketing
 
Customer focus and relationship management
Customer focus and relationship managementCustomer focus and relationship management
Customer focus and relationship management
 
Customer Focus
Customer FocusCustomer Focus
Customer Focus
 
10 Habits of Successful Creative People: How to change your mind and build cr...
10 Habits of Successful Creative People: How to change your mind and build cr...10 Habits of Successful Creative People: How to change your mind and build cr...
10 Habits of Successful Creative People: How to change your mind and build cr...
 
Relationship marketing
Relationship  marketingRelationship  marketing
Relationship marketing
 
Brochura lidando com dramas familiares Igreja do Nazareno
Brochura lidando com dramas familiares   Igreja do Nazareno Brochura lidando com dramas familiares   Igreja do Nazareno
Brochura lidando com dramas familiares Igreja do Nazareno
 
Frokostmøte 27.okt - Tom Martin Kj. Hartviksen, Ola Alsterholm, Hans Martin N...
Frokostmøte 27.okt - Tom Martin Kj. Hartviksen, Ola Alsterholm, Hans Martin N...Frokostmøte 27.okt - Tom Martin Kj. Hartviksen, Ola Alsterholm, Hans Martin N...
Frokostmøte 27.okt - Tom Martin Kj. Hartviksen, Ola Alsterholm, Hans Martin N...
 
Comoinstalaramor
ComoinstalaramorComoinstalaramor
Comoinstalaramor
 
Een onderzoek naar gefailleerde herstarters in vlaanderen
Een onderzoek naar gefailleerde herstarters in vlaanderenEen onderzoek naar gefailleerde herstarters in vlaanderen
Een onderzoek naar gefailleerde herstarters in vlaanderen
 
Book week1
Book week1Book week1
Book week1
 
11
1111
11
 
սամվել
սամվելսամվել
սամվել
 

Similar to 探讨Web优化

实时Web的前世今生未来
实时Web的前世今生未来实时Web的前世今生未来
实时Web的前世今生未来RolfZhang
 
从林书豪到全明星 - 虎扑网技术架构如何化解流量高峰
从林书豪到全明星 - 虎扑网技术架构如何化解流量高峰从林书豪到全明星 - 虎扑网技术架构如何化解流量高峰
从林书豪到全明星 - 虎扑网技术架构如何化解流量高峰Scourgen Hong
 
大众点评网的技术变迁之路
大众点评网的技术变迁之路大众点评网的技术变迁之路
大众点评网的技术变迁之路jeffz
 
[.Net开发交流会][2010.06.19]大众点评网的技术变迁之路(王宏)
[.Net开发交流会][2010.06.19]大众点评网的技术变迁之路(王宏)[.Net开发交流会][2010.06.19]大众点评网的技术变迁之路(王宏)
[.Net开发交流会][2010.06.19]大众点评网的技术变迁之路(王宏)Shanda innovation institute
 
Internet Cloud Operations - ChinaNetcloud & AWS Event Beijing
Internet Cloud Operations - ChinaNetcloud & AWS Event BeijingInternet Cloud Operations - ChinaNetcloud & AWS Event Beijing
Internet Cloud Operations - ChinaNetcloud & AWS Event BeijingChinaNetCloud
 
Async programming-2014-08-22-pub
Async programming-2014-08-22-pubAsync programming-2014-08-22-pub
Async programming-2014-08-22-pubpersia cai
 
鹰眼下的淘宝_EagleEye with Taobao
鹰眼下的淘宝_EagleEye with Taobao鹰眼下的淘宝_EagleEye with Taobao
鹰眼下的淘宝_EagleEye with Taobaoterryice
 
网易 李弈远 网易服务集成框架的构建与运维
网易 李弈远 网易服务集成框架的构建与运维网易 李弈远 网易服务集成框架的构建与运维
网易 李弈远 网易服务集成框架的构建与运维guiyingshenxia
 
网易 李弈远 网易服务集成框架的构建与运维
网易 李弈远 网易服务集成框架的构建与运维网易 李弈远 网易服务集成框架的构建与运维
网易 李弈远 网易服务集成框架的构建与运维colderboy17
 
胡涛:Cdn支撑平台构建实践分享
胡涛:Cdn支撑平台构建实践分享胡涛:Cdn支撑平台构建实践分享
胡涛:Cdn支撑平台构建实践分享Enlight Chen
 
Ch03 請求與回應
Ch03 請求與回應Ch03 請求與回應
Ch03 請求與回應Justin Lin
 
运维系统开发与Rails 3页面开发实践
运维系统开发与Rails 3页面开发实践运维系统开发与Rails 3页面开发实践
运维系统开发与Rails 3页面开发实践Li JianYe
 
刘源 人人网服务化与架构变迁V3
刘源 人人网服务化与架构变迁V3刘源 人人网服务化与架构变迁V3
刘源 人人网服务化与架构变迁V3drewz lin
 
新浪微博平台与安全架构
新浪微博平台与安全架构新浪微博平台与安全架构
新浪微博平台与安全架构n716
 
2014 Hpocon 黄慧攀 upyun - 平台架构的服务监控
2014 Hpocon 黄慧攀   upyun - 平台架构的服务监控2014 Hpocon 黄慧攀   upyun - 平台架构的服务监控
2014 Hpocon 黄慧攀 upyun - 平台架构的服务监控Michael Zhang
 
云计算技术与应用
云计算技术与应用云计算技术与应用
云计算技术与应用Yang Guanjun
 
BEA Weblogic Server 8.1 web service training
BEA Weblogic Server 8.1 web service trainingBEA Weblogic Server 8.1 web service training
BEA Weblogic Server 8.1 web service trainingwilliams2014
 
+++º+ ¦¦ ¦ ¦¦ ¦+ =
+++º+ ¦¦  ¦ ¦¦ ¦+ =+++º+ ¦¦  ¦ ¦¦ ¦+ =
+++º+ ¦¦ ¦ ¦¦ ¦+ =guesta6295f3
 
Ch03 請求與回應
Ch03 請求與回應Ch03 請求與回應
Ch03 請求與回應Justin Lin
 

Similar to 探讨Web优化 (20)

实时Web的前世今生未来
实时Web的前世今生未来实时Web的前世今生未来
实时Web的前世今生未来
 
从林书豪到全明星 - 虎扑网技术架构如何化解流量高峰
从林书豪到全明星 - 虎扑网技术架构如何化解流量高峰从林书豪到全明星 - 虎扑网技术架构如何化解流量高峰
从林书豪到全明星 - 虎扑网技术架构如何化解流量高峰
 
大众点评网的技术变迁之路
大众点评网的技术变迁之路大众点评网的技术变迁之路
大众点评网的技术变迁之路
 
[.Net开发交流会][2010.06.19]大众点评网的技术变迁之路(王宏)
[.Net开发交流会][2010.06.19]大众点评网的技术变迁之路(王宏)[.Net开发交流会][2010.06.19]大众点评网的技术变迁之路(王宏)
[.Net开发交流会][2010.06.19]大众点评网的技术变迁之路(王宏)
 
Internet Cloud Operations - ChinaNetcloud & AWS Event Beijing
Internet Cloud Operations - ChinaNetcloud & AWS Event BeijingInternet Cloud Operations - ChinaNetcloud & AWS Event Beijing
Internet Cloud Operations - ChinaNetcloud & AWS Event Beijing
 
Async programming-2014-08-22-pub
Async programming-2014-08-22-pubAsync programming-2014-08-22-pub
Async programming-2014-08-22-pub
 
鹰眼下的淘宝_EagleEye with Taobao
鹰眼下的淘宝_EagleEye with Taobao鹰眼下的淘宝_EagleEye with Taobao
鹰眼下的淘宝_EagleEye with Taobao
 
网易 李弈远 网易服务集成框架的构建与运维
网易 李弈远 网易服务集成框架的构建与运维网易 李弈远 网易服务集成框架的构建与运维
网易 李弈远 网易服务集成框架的构建与运维
 
网易 李弈远 网易服务集成框架的构建与运维
网易 李弈远 网易服务集成框架的构建与运维网易 李弈远 网易服务集成框架的构建与运维
网易 李弈远 网易服务集成框架的构建与运维
 
胡涛:Cdn支撑平台构建实践分享
胡涛:Cdn支撑平台构建实践分享胡涛:Cdn支撑平台构建实践分享
胡涛:Cdn支撑平台构建实践分享
 
Ch03 請求與回應
Ch03 請求與回應Ch03 請求與回應
Ch03 請求與回應
 
运维系统开发与Rails 3页面开发实践
运维系统开发与Rails 3页面开发实践运维系统开发与Rails 3页面开发实践
运维系统开发与Rails 3页面开发实践
 
刘源 人人网服务化与架构变迁V3
刘源 人人网服务化与架构变迁V3刘源 人人网服务化与架构变迁V3
刘源 人人网服务化与架构变迁V3
 
Storage
StorageStorage
Storage
 
新浪微博平台与安全架构
新浪微博平台与安全架构新浪微博平台与安全架构
新浪微博平台与安全架构
 
2014 Hpocon 黄慧攀 upyun - 平台架构的服务监控
2014 Hpocon 黄慧攀   upyun - 平台架构的服务监控2014 Hpocon 黄慧攀   upyun - 平台架构的服务监控
2014 Hpocon 黄慧攀 upyun - 平台架构的服务监控
 
云计算技术与应用
云计算技术与应用云计算技术与应用
云计算技术与应用
 
BEA Weblogic Server 8.1 web service training
BEA Weblogic Server 8.1 web service trainingBEA Weblogic Server 8.1 web service training
BEA Weblogic Server 8.1 web service training
 
+++º+ ¦¦ ¦ ¦¦ ¦+ =
+++º+ ¦¦  ¦ ¦¦ ¦+ =+++º+ ¦¦  ¦ ¦¦ ¦+ =
+++º+ ¦¦ ¦ ¦¦ ¦+ =
 
Ch03 請求與回應
Ch03 請求與回應Ch03 請求與回應
Ch03 請求與回應
 

探讨Web优化