Presentation is loading. Please wait.

Presentation is loading. Please wait.

Linux Command Tips.

Similar presentations


Presentation on theme: "Linux Command Tips."— Presentation transcript:

1 Linux Command Tips

2 Free Memory Free memory reported by free and vmstat command on Linux is not the total memory free. Total memory free is sum of free and cached memory. Cached memory is still technically *free* memory that can be used. The OS just doesn't free it, it keeps it there to help speed up other applications that may need the data there. So when monitoring free memory graph of monitor, we need to look at both ‘Free memory’ and ‘Cached memory’ to see if there is any memory leak or not.

3 Free Memory For example, let us see the output of free command when test is running: TR4166]$ free -l total used free shared buffers cached Mem: Low: High: -/+ buffers/cache: Swap:  Total free memory = KB = KB = 3707 MB (Approx) = 3.7 GB (Approx) Total memory is approx 4 GB

4 Free Memory Free memory can be verified from vmstat command.
TR4166]$ vmstat 5 procs memory swap io system cpu------ r b swpd free buff cache si so bi bo in cs us sy id wa st

5 Free Memory Free memory can be verified from vmstat command.
TR4166]$ vmstat 5 procs memory swap io system cpu------ r b swpd free buff cache si so bi bo in cs us sy id wa st

6 Process Data For example: ps -p 29620 -o vsz,cputime,etime,args
Process Data Monitor (cm_ps_data) Used to get process data Elapsed Time in seconds CPU Used Time in seconds Process size in KB Uses following command to get the data ps –p <pid> -o vsz,cputime,etime,args For example: ps -p o vsz,cputime,etime,args VSZ TIME ELAPSED COMMAND :01: :49: tomcat VSZ in Kilo-bytes

7 Process Data Issues in AIX
Virtual memory size (VSZ) on AIX In AIX box, virtual memory size (VSZ) is so small, often even smaller then the resident set size (RSS) It's not the virtual memory size. It is actually the size of the data section of the virtual memory of the process. To get VSZ of a process, use svmon -P <pid>, Multiply this by the pagesize (pagesize(1) is a user tool on AIX).

8 Process/Thread waiting
It seems like vmstat r col is different on AIX and LINUX Description of r col in vmstat from AIX manual () - r Average number of kernel threads that are runnable, which includes threads that are running and threads that are waiting for the CPU. If this number is greater than the number of CPUs, there is at least one thread waiting for a CPU and the more threads there are waiting for CPUs, the greater the likelihood of a performance impact. Based on description above we should probably only worry if the r is 150% or number of logical processors NOT 50% . Makes sense ? For Linux, I see conflicting data points " r Number of threads that are running or are runnable."   From here " The number of processes waiting for run time."  (man vmstat - on  NetStorm box FC9)  (ref) NeerajR - can you comment ? on AIX what number would you compare the 'Processes waiting for runtime' value returned in vmstat, as number of processors. lcpu ? On this machine, the 'Processors used' caps out to 4. Do you know why ? Any relation to smt ? I thought it would be 16 ? Also do we have any monitors for lparstat -- there seems to be a lot of information in there $ lparstat System configuration: type=Shared mode=Uncapped smt=4 lcpu=16 mem=32768MB psize=32 ent=1.50 %user  %sys  %wait  %idle physc %entc  lbusy   app  vcsw phint      6.1   2.1    0.0   91.8  0.18  12.1    $ No virus found in this incoming message. Checked by AVG - Version: / Virus Database: / Release Date: 02/09/11 19:34:00

9 THANK YOU

10


Download ppt "Linux Command Tips."

Similar presentations


Ads by Google