資源描述:
《性能測(cè)試之循序漸進(jìn)》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在應(yīng)用文檔-天天文庫(kù)。
1、附錄A:?案例學(xué)習(xí)?性能監(jiān)控之循序漸進(jìn)某一天,一個(gè)客戶打電話來(lái)需要技術(shù)幫助,并抱怨平常15秒就可以打開(kāi)的網(wǎng)頁(yè)現(xiàn)在需要20分鐘才可以打開(kāi).?具體系統(tǒng)配置如下:?RedHat?Enterprise?Linux?3?update?7?Dell?1850?Dual?Core?Xenon?Processors,?2?GB?RAM,?75GB?15K?Drives?Custom?LAMP?software?stack(Llinux+apache+mysql+php?環(huán)境)?性能分析之步驟1.?首先使用vmstat?查看大致的系統(tǒng)性能情況:?#?vmstat?1?10?procs?memor
2、y?swap?io?system?cpu?r?b?swpd?free?buff?cache?si?so?bi?bo?in?cs?us?sy?id?wa?1?0?249844?19144?18532?1221212?0?0?7?3?22?17?25?8?17?18?0?1?249844?17828?18528?1222696?0?0?40448?8?1384?1138?13?7?65?14?0?1?249844?18004?18528?1222756?0?0?13568?4?623?534?3?4?56?37?2?0?249844?17840?18528?1223200?0?0?
3、35200?0?1285?1017?17?7?56?20?1?0?249844?22488?18528?1218608?0?0?38656?0?1294?1034?17?7?58?18?0?1?249844?21228?18544?1219908?0?0?13696?484?609?559?5?3?54?38?0?1?249844?17752?18544?1223376?0?0?36224?4?1469?1035?10?6?67?17?1?1?249844?17856?18544?1208520?0?0?28724?0?950?941?33?12?49?7?1?0?249844
4、?17748?18544?1222468?0?0?40968?8?1266?1164?17?9?59?16?1?0?249844?17912?18544?1222572?0?0?41344?12?1237?1080?13?8?65?13?分析:?1,不會(huì)是內(nèi)存不足導(dǎo)致,因?yàn)閟wapping?始終沒(méi)變化(si?和so).盡管空閑內(nèi)存不多(free),但swpd?也沒(méi)有變化.?2,CPU?方面也沒(méi)有太大問(wèn)題,盡管有一些運(yùn)行隊(duì)列(procs?r),但處理器還始終有50%?多的idle(CPU?id).?3,有太多的上下文切換(cs)以及disk?block從RAM中被讀入(bo).?
5、4,CPU?還有平均20%?的I/O?等待情況.?結(jié)論:?從以上總結(jié)出,這是一個(gè)I/O?瓶頸.?2.?然后使用iostat?檢查是誰(shuí)在發(fā)出IO?請(qǐng)求:?#?iostat?x?1?Linux?2.4.2140.ELsmp?(mail.example.com)?03/26/2007?avgcpu:?%user?%nice?%sys?%idle?30.00?0.00?9.33?60.67?Device:?rrqm/s?wrqm/s?r/s?w/s?rsec/s?wsec/s?rkB/s?wkB/s?avgrqsz?avgqusz?await?svctm?%util?/dev/sda?
6、7929.01?30.34?1180.91?14.23?7929.01?357.84?3964.50?178.92?6.93?0.39?0.03?0.06?6.69?/dev/sda1?2.67?5.46?0.40?1.76?24.62?57.77?12.31?28.88?38.11?0.06?2.78?1.77?0.38?/dev/sda2?0.00?0.30?0.07?0.02?0.57?2.57?0.29?1.28?32.86?0.00?3.81?2.64?0.03?/dev/sda3?7929.01?24.58?1180.44?12.45?7929.01?297.50?
7、3964.50?148.75?6.90?0.32?0.03?0.06?6.68?avgcpu:?%user?%nice?%sys?%idle?9.50?0.00?10.68?79.82?Device:?rrqm/s?wrqm/s?r/s?w/s?rsec/s?wsec/s?rkB/s?wkB/s?avgrqsz?avgqusz?await?svctm?%util?/dev/sda?0.00?0.00?1195.24?0.00?0.00?0.00?0.00?0.00?0.00?43.69?3.