/srv/irclogs.ubuntu.com/2011/01/27/#ubuntu-classroom.txt

=== zkriesse_ is now known as zkriesse
=== Liquid is now known as Guest91228
=== fenris is now known as Guest20801
=== Guest20801 is now known as ejat
=== yofel_ is now known as yofel
EBC3morning all14:49
=== xx is now known as Guest14855
the_hydrai am ready for the upcoming session...15:49
resno6 more mins15:54
nigelbFolks, special announcement.15:58
nigelbToday is the_hydra's birthday!15:58
nigelbAnd he's celebrating that by giving a session in -classroom!15:58
* the_hydra bows to everyone 15:58
resnohappy birthday the_hydra15:59
resnoby the way, we arent muted ;)15:59
the_hydraresno: thanks...I hope I do something meaningful15:59
the_hydraok, is it now?15:59
resnothe_hydra: me too15:59
resnoits 11 am!16:00
the_hydraok, let's begin, shall we?16:00
nigelbhang on for a minute16:01
the_hydrak...16:01
nigelbthe classbot should kick in16:01
resnowhats the chat channel?16:02
the_hydra"ubuntu-classroom-chat" AFAIK16:03
resnothanks16:03
the_hydraok people, let's roll16:03
the_hydratoday, I am gonna discuss about how to use monitoring tools in Linux to pinpoint system problems such as lack of RAM and so on16:03
the_hydrawhat we're gonna quickly observe here is top, vmstat and friends16:04
the_hydra"top" is a classic...you will likely find it in every UNIX flavour....16:04
the_hydraif you look closer, "top" display almost everything, your CPU usage, memory usage, process statistics16:05
the_hydrathey're either displayed as percentage or number...mostly..16:05
the_hydrafor example, CPU usage...are divided into user and system (marked as "us" and "sy")16:06
the_hydraanyone has idea what they mean?16:06
c2tarunus: processes that are controlled by user account16:07
c2tarunand don't have there system account (i guess)16:07
the_hydraother ideas?16:07
obengdakowell like you said us for user and sy for system16:07
the_hydraalright, "us" means time spent in user mode16:08
resnouser: processes that the user owns or runs16:08
the_hydrawhile "sy" is system16:08
the_hydralet's pick cp16:08
the_hydrawhen you copy a file with it, cp do two things actually:16:08
the_hydra1. read the data from disk16:08
the_hydra2. copy it to memory area, and write it somewhere16:09
the_hydraread and write to disk are example of system work16:09
the_hydrawhile pasting them to temporary buffer in RAM is user mode16:09
the_hydraor to make it simple, "sy" is anything where kernel is involved16:10
c2tarunthe_hydra: What does it actually mean by user mode?16:10
the_hydrameaning, it could entirely done without kernel involved16:10
c2tarunok16:10
the_hydrae.g: number operation (substract, multiplication)16:10
the_hydraso, let's bring this knowledge when observing top16:11
the_hydrahigh "us" means CPU is busy doing very likely number crunching16:11
the_hydrayou guys got a figure what number crunching is?16:11
obengdakosorry guys but aren't we supposed to ask questions in the chat section because i just asked there and see others ask here16:11
the_hydraok wait16:12
the_hydraQ: obengdako : i realise for cpu there is also ni id wa hi si st what do they mean?16:13
the_hydrani is a field that tells us how much CPU time is spent to work on "niced" jobs16:13
the_hydranice means any process with priority higher than 016:14
the_hydrathese jobs are likely to be scheduled less frequently...because CPU prioritize bigger ones16:14
the_hydraid --> idle... CPU idle a.k.a resting :)16:15
the_hydrawa--> ok this is interesting16:15
the_hydraever wonder on event like waiting cp or rsync doing large files transfer?16:15
the_hydraalthough they spent time in user and system mode, but they spend more in waiting....16:16
the_hydrawhy wait? because the data need to be read from the disk spindle16:16
the_hydrareading from disk are thousands time slower rather than from RAM...so you got the picture16:17
the_hydraother example are waiting data from network16:17
the_hydraso next time you see high number it %wa, go check if an application is sitting in background doing I/O16:17
the_hydraQ: <obengdako> when you say higher you mean greater than zero and meaning a lower priority?16:18
the_hydrain priority, bigger number means lower priority16:18
the_hydraso +5 vs -5, -5 wins :)16:18
the_hydranext: si and hi...16:19
the_hydrathey are interrupts actually16:19
the_hydraif it's quite big, let's say 50%, then very likely a device is "interrupting" your CPU too much16:20
the_hydrait could be sending data, a damaged hardware and so on16:20
the_hydralately, thanks to DMA (Direct Memory access), CPU is less likely involved in hardware operation, so you can be more relaxed in regards to CPU utilization16:21
the_hydraQ: <obengdako> so ni will be for the higher priority stuff that have figures less than zero eg. pulseaudio at -1116:21
the_hydranope, -11 isn't accounted in %ni16:22
the_hydraonly if e.g pulse audio is marked as +516:22
the_hydraQ: <obengdako> so would si be system interrupt and hi be hardware interrupt?16:23
the_hydranope, si is "soft interrupt"16:23
the_hydrawhile "hi" is hard interrupt16:23
the_hydra"hi" for example is interrupt coming from your keyboard received by the CPU16:23
the_hydraand "si"? you can think like this: Linux kernel splits the job of taking care your hardware in two "session"...initially, in "hard interrupt" mode16:24
the_hydrawhich is done as fast as possible16:24
the_hydraand later, the rest is done in "soft interrupt"16:25
the_hydraso both represents the job when system is handling hardware most of the times16:25
the_hydralet me pause briefly here...16:25
the_hydranote: likely you will just need to watch %id16:26
the_hydrabecause, by knowing it, you could have idea how busy the CPUs are :)16:26
the_hydrafor example, %id is 99%16:26
the_hydraso CPU is only busy 1%16:26
the_hydrapress "1" to get per core/ per physical CPU statistic16:27
the_hydraby default what you see there is  the sum of all CPUs16:27
the_hydraQ: <obengdako> final about ni so desktopcouch-se with ni of 10 will be accounted for in %ni and not pulseaudio with -11 ?16:28
the_hydracorrect obengdako16:28
the_hydraand if you suspect slowness but you think Linux is "doing nothing", check %wa16:28
the_hydraif it's bigger than 0, then.....it's doing I/O e.g reading your USB thumbdrive16:29
the_hydraQ: <himuraken-mobile> How to switch back to sum of all cpu?16:29
the_hydrasimple, "1" again :D16:30
the_hydrait's a toggle :D16:30
the_hydraok, slipped something...16:30
the_hydrasee "zombie" field?16:30
the_hydragot idea what that is?16:30
the_hydra<resno> zombies are processes that havent quit yet16:31
the_hydracorrect...16:31
the_hydraso, if you see that field is bigger than zero...very likely you see bugs in the current running applications16:32
the_hydrato pin point it, you can use "ps" or "top" in batch mode and look out for process with "Z" status16:32
the_hydrasuch as "ps auxww | grep Z"16:33
the_hydraAFAIK to get rid of it, you have to kill the "master" process16:33
the_hydrapstree could help locate the parent of the zombie16:33
the_hydraQ: <obengdako> how do i use top in batch mode?16:34
the_hydrause -b switch16:34
the_hydraplease note that batch mode will use any setting you have written to ~/.toprc16:34
the_hydrafor example, you have set that you only display 20 process (by pressing "n" in top"), then in batch mode you will only see 20 process listed too16:35
the_hydrabatch mode is an alternative way to continously monitor your system but in non interactive mode :)16:36
the_hydraok, may I move to memory part?16:36
the_hydrayou will likely think "great, all my RAM are used?"16:37
the_hydra"all are my app that hungry"16:37
the_hydramost likely no...check buffers and cached field16:37
the_hydrathe bigger they are, meaning Linux is caching some of recently accessed files in your RAM16:38
the_hydrathe purpose? to speed up the next access toward those files16:38
the_hydraQ: <resno> the_hydra: did you talk about st?16:39
the_hydrast is "steal"16:39
the_hydrawhat is stealed?16:39
the_hydrait's introduced in this virtualization hype era16:39
the_hydrait means some of your CPU time are accounted for doing something for the virtual machine16:40
the_hydraso if you run plenty virtual machines (be it KVM, Xen, Qemu in KVM mode etc), you will see this field increased16:40
the_hydraswap used is bigger than 0? meaning: you need more RAM... :)16:41
the_hydraseriously: swapping should be avoided actually...so if you have budget and can afford for bigger RAM, buy them..it will make your machine runs faster16:42
the_hydrathese days, 2 GiB is the lowest amount of RAM you should have IMHO16:42
=== ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Current Session: How to use top and similar tools to pinpoint system problems - Instructors: the_hydra
nigelbdoh16:43
ClassBotresno asked: Is there a way to tell when the CPU is not keeping up.  As in when more RAM wont help.16:46
the_hydrawhile %sy and %us are nice clue, for better indication use load average field16:47
the_hydrathose three number represents loads during the last 5, 10 and 15 minutes respectively16:47
the_hydrabut what is "load"?16:47
the_hydrathe simplest meaning is: the average number of process running per core16:48
the_hydraso if you have quad core and you see -/+ 4.0, it means per core are fairly constantly running 1 process16:48
ClassBotobengdako asked: so if my swap is never used according to top can i delete the swap partition?16:49
the_hydrabetter not..think swap like the emergency room16:49
the_hydraif you have no swap and suddenly your application need more "memory", you will ended with situation called OOM (out of memory)16:50
the_hydrathe effect? your app will be killed....:D16:50
the_hydramust be hurry :)16:50
ClassBotThere are 10 minutes remaining in the current session.16:50
the_hydraprocess field....you can sort them here..press "M" to sort them by memory usage16:51
the_hydraand "P16:51
the_hydrafor CPU usage16:51
the_hydraso if you wanna get quick idea which one is hungry for RAM...press M...then kazaam...you know it :)16:52
the_hydrapay attention that for finer grained statistics, you need to lower the update...press "s" and make it somewhere between 3 and 516:53
the_hydraanything higher will make top update quite slow16:53
the_hydrabut if it is lower than that, you will make top itself one of top  CPU consumer :)16:54
the_hydraVSZ or RSS, which one represents memory usage?16:54
the_hydracorrect answer is RSS16:54
the_hydrayou can think VSZ like the final plan construction of  a building16:55
the_hydrawhile RSS is current progress of building construction itself16:55
ClassBotThere are 5 minutes remaining in the current session.16:55
the_hydraeffectively use "P" and "M" will help you to find out question like "machine feels slow, ok who's the suspect?"16:56
the_hydraagain, questions?16:56
ClassBotobengdako asked: sorry but where from RSS and VSZ are they in top? or should i google?16:56
the_hydraoh sorry, I mean RES and VIRT16:57
the_hydraVIRT=virtual size (final plan construction"16:57
the_hydraRES= current construction progress16:57
the_hydrai think we got 2-3 minutes left16:58
the_hydrabtw, press "f" in top...you have plenty choice of fields there16:58
the_hydraperhaps another time,I shall discuss them16:59
ClassBotobengdako asked: so is that like the maximum possible allocation for an app (virt) and res the current allocation?16:59
the_hydranot really...virt itself can expand16:59
the_hydrabut compared to RSS, it is likely to change too frequently17:00
the_hydrait is not, I mean17:00
ClassBotLogs for this session will be available at http://irclogs.ubuntu.com/2011/01/27/%23ubuntu-classroom.html17:01
=== ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat ||
obengdakowow great session the_hydra17:01
nigelbThanks for the wonderful session the_hydra and Happy birthday again!17:02
the_hydrasorry if the time feels too narrow, guys17:03
=== tubadaz_ is now known as tubadaz
=== Raist is now known as Guest98867

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!