Вы находитесь на странице: 1из 19

developerWorks

Technicaltopics

AIXandUNIX

Technicallibrary

nmonperformance:AfreetooltoanalyzeAIXand
Linuxperformance
Thisfreetoolgivesyouahugeamountofinformationallononescreen.EventhoughIBMdoesn'tofficiallysupportthe
toolandyoumustuseitatyourownrisk,youcangetawealthofperformancestatistics.Whyusefiveorsixtools
whenonefreetoolcangiveyoueverythingyouneed?

Share:
NigelGriffithsworksintheIBMeServerpSeriesTechnicalSupportAdvancedTechnologyGroup.Hespecialisesinperformance,sizing,
tools,benchmarks,andOracleRDBMS.Thenmontoolwasdevelopedtosupportbenchmarksandperformancetuningforinternaluse,butby
populardemandisgivenawaytodeservingfriends.Ifyouhaveaquestiononnmon,pleasegoonthePerformanceToolsForumsite(see
Resources)sothatotherscanfindandbenefitfromtheanswers.Toprotectyouremailaddressfromjunkmail,youneedtocreateaUSERID
first(takes20secondsatmost).

27February2006(Firstpublished04November2003)
AlsoavailableinChineseRussian

Usagenotes:ThisnmontoolisNOTOFFICIALLYSUPPORTED.No
warranteeisgivenorimplied,andyoucannotobtainhelpwithitfromIBM.If
youhaveaquestiononnmon,pleasegoonthePerformanceToolsForum
site(seeResources)sothatotherscanfindandbenefitfromtheanswers.
Toprotectyouremailaddressfromjunkmail,youneedtocreateaUSERID
first(takes20secondsatmost).
Thenmontoolrunson:

Developanddeployyour
next
appontheIBMBluemix
cloudplatform.

Startbuildingforfree

AIX4.1.5,4.2.0,4.3.2,and4.3.3(nmonVersion9a:Thisversionisfunctionallyestablishedandwill
notbedevelopedfurther.)
AIX5.1,5.2,and5.3(nmonVersion10:ThisversionnowsupportsAIX5.3andPOWER5processor
basedmachines,withSMTandsharedCPUmicropartitions.)
LinuxSUSESLES9,RedHatEL3and4,DebianonpSeriesp5,andOpenPower
LinuxSUSE,RedHat,andmanyrecentdistributionsonx86(IntelandAMDin32bitmode)
LinuxSUSEandRedHatonzSeriesormainframe
Thenmontoolisupdatedroughlyeverysixmonths,orwhennewoperatingsystemreleasesare
available.Toplaceyournameontheemaillistforupdates,contactNigelGriffiths.
Usethistooltogetherwithnmonanalyser(seeResources),whichloadsthenmonoutputfileand
automaticallycreatesdozensofgraphs.

Introduction
ThenmontoolisdesignedforAIXandLinuxperformancespecialiststouseformonitoringandanalyzing
performancedata,including:
CPUutilization
Memoryuse
Kernelstatisticsandrunqueueinformation
DisksI/Orates,transfers,andread/writeratios
Freespaceonfilesystems

Diskadapters
NetworkI/Orates,transfers,andread/writeratios
Pagingspaceandpagingrates
CPUandAIXspecification
Topprocessors
IBMHTTPWebcache
Userdefineddiskgroups
Machinedetailsandresources
AsynchronousI/OAIXonly
WorkloadManager(WLM)AIXonly
IBMTotalStorageEnterpriseStorageServer(ESS)disksAIXonly
NetworkFileSystem(NFS)
DynamicLPAR(DLPAR)changesonlypSeriesp5andOpenPowerforeitherAIXorLinux
Alsoincludedisanewtooltogenerategraphsfromthenmonoutputandcreate.giffilesthatcanbe
displayedonaWebsite.
SeetheREADMEfileformoredetails.

Benefitsofthetool
Thenmontoolishelpfulinpresentingalltheimportantperformancetuninginformationononescreenand

dynamicallyupdatingit.Thisefficienttoolworksonanydumbscreen,telnetsession,orevenadialup
line.Inaddition,itdoesnotconsumemanyCPUcycles,usuallybelowtwopercent.Onnewermachines,
CPUusageiswellbelowonepercent.
Dataisdisplayedonthescreenandupdatedonceeverytwoseconds,usingadumbscreen.However,
youcaneasilychangethisintervaltoalongerorshortertimeperiod.Ifyoustretchthewindowand
displaythedataonXWindows,VNC,PuTTY,orsimilar,thenmontoolcanoutputagreatdealof
informationinoneplace.
Thenmontoolcanalsocapturethesamedatatoatextfileforlateranalysisandgraphingforreports.The
outputisinaspreadsheetformat(.csv).

Installingthetool
Thetoolisastandalonebinaryfile(adifferentfileforeachAIXorLinuxversion)thatyoucaninstallin
fiveseconds,probablylessifyoutypefast.Installationissimple:
CopythenmonXXX.tar.Zfiletothemachine.IfusingFTP,remembertousebinarymode.
Note:VersionXXXreplacesthisexample.
Touncompressthefile,rununcompress nmonXX.tar.Z.
Toextractthefiles,runtar xvf nmonXX.tar.
ReadtheREADMEfile.
Tostartthenmontool,typenmon.
Ifyouaretherootuser,youmightneedtotype./nmon.

Extranotesforusingnmon9forAIX4only

1. Youmustbetherootuserorallowregularuserstoreadthe/dev/kmemfilebytypingthefollowing
command(asroot):
chmod ugo+r /dev/kmem

2. Ifyouwantthediskstatistics,thenalsorun(asroot):
chdev -l sys0 -a iostat=true

Howtorunthetoolinteractively
Forrunningthetoolinteractively,readthefrontpageofthefileforafewhints.Thenstartthetoolanduse
theonekeycommandstoseethedatayouwant.Forexample,togetCPU,Memory,andDiskstatistics,
startnmonandtype:
cmd

Howtogethelpinformationwhilerunninginteractively
Pressthehkey.

Additionalhelpinformation
Foradditonalhelpinformation,trythefollowing:
Typethenmon -?commandforbriefdetails.
Typethenmon -hcommandforfulldetails.
ReadtheREADMEfile.

Howtocapturethedatatoafileforlateranalysisandgraphing
Runnmonwiththefflag.Seenmon -hforthedetails.Butasanexample,trytorunnmonforanhour
capturingdatasnapshotsevery30secondsbyusing:
nmon -f -s 30 -c 120
nmon -fT -s 30 -c 120

Thesecondlinealsocapturesthetopprocesses.Bothofthesecreatetheoutputfileinthecurrent
directorycalled:
<hostname>_date_time.nmon

Thisfileisinacommaseparatedvalues(CSV)formatandcanbeimportedintoaspreadsheetdirectly.If
youareusingLotus123,thefileneedstobesorted.(ThisisnotrequiredfortheExcelversionofthe
nmonanalyser.)OnAIX,followthisexample:
sort -A mymachine_311201_1030.nmon > xxx.csv

Notestosaveyoutime:
Toloadthenmondatacapturefileintoaspreadsheet,checkthespreadsheetdocumentationforloading
CSVdatafiles(.csv).Manyspreadsheetsacceptthisdataasjustoneofthepossiblefilestoloador
provideanimportfunctiontodothis.Manyspreadsheetshaveafixednumberofcolumnsandrows.I
suggestyoucollectamaximumof300snapshotstoavoidhittingtheseissues.
Whenyouarecapturingdatatoafile,nmondisconnectsfromtheshelltoensurethatitcontinues
running,evenifyoulogout.Thismeansthatnmoncanappeartocrash,eventhoughit'sstillrunningin
thebackground.Toseeiftheprocessisstillrunning,type:
ps ?ef | grep nmon

ReadtheREADMEfileformoreinformationaboutwhichversionofnmontorunonyourparticular
operatingsystem.
nmonVersion10forAIX5nolongeruses/dev/kmem,butonlypublicAPIs.So,youdon'thavetochage

thepermissionson/dev/kmem,andthereisnoneedtohave32and64bitversionsofnmon.
ForAIX5.1,5.2,and5.3,usenmon10.

OnAIX,don'treportlslpp -Lcq bos.?pcoredumpsonAIX5.1,aboutML03onwards.Also,WLM


statsgomissingafterupgradingtoAIX5.2ML5toNigelGriffiths,astheseareAIXbugs.Theseare
avoidedbyusingnmonVersion10.
Don'tuseMicrosoftWindowsTelnetandusealargerwindowthan80x25characters.Many
developersuseVNCandPuTTYtodisplaynmonfromaWindowsmachinewhynotdothesame!

NewfeaturesfornmononAIXVersion10
New
Features

Description

Startingup

Thereisalsonowasmallshellscriptcalled"nmon"thatstartstherightnmonversion.
Placethisscriptandnmonbinariesinyour$PATHandtype:nmon.Thisversionis
nowonlycompiledin32bitmode.So,itrunson32and64bithardware.Theideais
tomakeiteasiertoinstallandrun.

N=NFS

NFSiscompletelynewfornmon10.

p=
Partitions

ThisisforsharedCPUpartitionsinformationthebigp5/AIX5.3feature.

C=CPU

Thisisformachineswith32plusCPUsupto128logicalCPUsbydemand.

c=CPU

DetailsyourphysicalCPUuseifyouareonaPOWER5withAIX5.3andina
sharedCPUenvironment.

S=
Subclass

ThisisforWLMsubclassesbyrequest.

a=Disk
adapters

Givesyoudetailsofthediskadapterliketheirfulltype.

r=

ThisincludesyourCPUspeedinMHz.

Resources
k=Kernel

Givessomenewfields.

L=Large
pages

Givesyoulargepagestatspopularwithhighperformanceguys.

D=Disk

Givesyoumoreinformationaboutyourdisks,disktypesizes,free,volumegroups,
adapter,andsoforth.

n=Network

Givesyouinformationaboutyournetworkadaptersdetails,MTU,anderrors.

m=Memory

Givesyoumoredetailsonwhereyourmemoryisgoing,system(kernel)and
processes,andactivevirtualmemory.

Thisisastartupoptiontoremovetheboxes.

Sampleoutputfornmon10forAIX5
Figure1belowisasampleofthescreenoutput.ItshowstheopeningscreenforAIX5,withlotsofuseful
information.
Figure1.Sampleoutputfornmon10forAIX5

Figure2illustratesthedetailsforCPU(thisisa4CPUPOWER5machinewithSMTswitchedon),
memoryuse,kernelinternalstatistics,anddisksstatistics.Note:Thislogicalpartition(LPAR)isusingsix
timesitsentitlementinhalfaCPU.
Figure2.CPUdetails

Figure3showsthedetailsofthenetwork,NFSstatistics,andjournalfilesystemuse.
Figure3.Networkdetails

ThedetailsofthePOWER5sharedprocessormicropartitionsstatisticsareshowninFigure4below.
Figure4.LPARdetails

Figure5illustratesthedetailsoftheLinuxversionofnmon,showingtheCPU(thisisa2CPUPOWER5
machinewithSMTswitchedon),LPARstatistics,memoryuse,networkstatistics,filesystemuse,and

disksstatistics.Note:ThephysicalCPUofthisLPARisonlyavailablewithSUSESLES9ServicePack1
andRedHatEL4Update1.
Figure5.Linuxversionofnmon

Figure6showstheOSdetailsofthemachine,diskstatistics(detailedmode),andthetopprocesses.

Figure6.Linuxversionofnmoncontinued

Obtainingthetool
Thefollowingdownloadoptionsareavailable:
YoucandownloadnmonanditstoolsfromIBMWikiathttp://www
941.haw.ibm.com/collaboration/wiki/display/WikiPtype/nmon.
CheckoutthePerformanceToolsforumfornmonquestionsandideasathttp://www
03.ibm.com/systems/p/community/.

Resources
Learn
"nmonanalyserAfreetooltoproduceAIXperformancereports"
(developerWorks,April2006):Produceawealthofreportreadygraphsfrom
nmonoutput.
CheckoutthefollowingIBMRedbooksforadditionalinformationon
performance:
UnderstandingIBMpSeriesPerformanceandSizing,SG24481001,
Febraruary2001
DatabasePerformanceonAIXintheDB2UDBandOracleEnvironments,
SG245511,January2003
AIX5LPerformanceToolsHandbook,SG246039,August2003
CheckoutotherarticlesandtutorialswrittenbyNigelGriffiths:
AIXandUNIXzone
AcrossIBManddeveloperWorks
"AIX5performanceseries:CPUmonitoringandtuning":Browsethroughthis

DigdeeperintoAIXandUnixon
developerWorks
Overview
NewtoAIXandUnix
Technicallibrary(tutorialsandmore)
Forums
Community
Downloadsandproducts
Opensourceprojects
Events

BluemixDevelopers
Community
Getsamples,articles,product
docs,andcommunityresourcesto
helpbuild,deploy,andmanage
yourcloudapps.

developerWorksWeekly
Newsletter
Keepupwiththebestandlatest

articletogetridofyourCPUbottlenecksandimproveperformance.

technicalinfotohelpyoutackle
yourdevelopmentchallenges.

SearchtheAIXandUNIXlibrarybytopic:
Systemadministration

DevOpsServices

Applicationdevelopment

Softwaredevelopmentinthecloud.
Registertodaytocreateaproject.

Performance
Porting
Security
Tips
Toolsandutilities
Javatechnology
Linux
Opensource
AIXandUNIX:TheAIXandUNIXdeveloperWorkszoneprovidesawealthof
informationrelatingtoallaspectsofAIXsystemsadministrationand
expandingyourUNIXskills.
NewtoAIXandUNIX:VisittheNewtoAIXandUNIXpagetolearnmore
aboutAIXandUNIX.
AIX5LWiki:Acollaborativeenvironmentfortechnicalinformationrelatedto
AIX.
IBMPowerSystemsonIBMPartnerWorld
Safaribookstore:Visitthisereferencelibrarytofindspecifictechnical
resources.
developerWorkstechnicaleventsandwebcasts:Staycurrentwith

IBMevaluationsoftware
EvaluateIBMsoftwareand
solutions,andtransform
challengesintoopportunities.

developerWorkstechnicaleventsandwebcasts.
Podcasts:TuneinandcatchupwithIBMtechnicalexperts.
Getproductsandtechnologies
IBMtrialsoftware:Buildyournextdevelopmentprojectwithsoftwarefor
downloaddirectlyfromdeveloperWorks.
nmon:Downloadnmonanditstools.
Discuss
ParticipateinthedeveloperWorksblogsandgetinvolvedinthe
developerWorkscommunity.
ParticipateintheAIXandUNIXforums:
AIX5Ltechnicalforum
AIXforDevelopersForum
ClusterSystemsManagement
IBMSupportAssistant
PerformanceToolstechnical
Virtualizationtechnical
MoreAIXandUNIXforums
nmonquestions:CheckoutthePerformanceToolsforumfornmonquestions
andideas.

Вам также может понравиться