Solved

Performance issue

Posted on 2013-05-27
9
332 Views
Last Modified: 2013-08-27
top - 09:12:44 up 388 days, 17:09,  1 user,  load average: 1.47, 0.85, 0.40
Tasks: 163 total,   2 running, 161 sleeping,   0 stopped,   0 zombie
Cpu(s): 16.0%us,  6.3%sy,  0.0%ni, 56.7%id, 15.8%wa,  0.4%hi,  4.8%si,  0.0%st
Mem:   8043428k total,  7930920k used,   112508k free,     1136k buffers
Swap:  4194296k total,  3804432k used,   389864k free,   740040k cached


can some advise how to troubleshoot this swap issue?
0
Comment
Question by:ittechlab
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
9 Comments
 
LVL 34

Expert Comment

by:Duncan Roe
ID: 39199132
I suspect some program is leaking memory. To find it, run top -b -n 1 | less and look down the VIRT column for a whopper. That will be the culprit.
0
 

Author Comment

by:ittechlab
ID: 39199148
what is VIRT? can i sort VIRT and how?
0
 
LVL 34

Accepted Solution

by:
Duncan Roe earned 500 total points
ID: 39199847
VIRT is a heading in the output from top, right after the headings as you posted. You should have seen it when you tried the command I posted. Like this
07:18:26$ top -b -n 1 | less
top - 07:37:59 up 22 min, 12 users,  load average: 0.00, 0.05, 0.20
Tasks: 174 total,   1 running, 173 sleeping,   0 stopped,   0 zombie
Cpu(s):  1.7%us,  0.7%sy,  0.0%ni, 95.2%id,  2.3%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   8302872k total,   539704k used,  7763168k free,    42336k buffers
Swap:        0k total,        0k used,        0k free,   250412k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND            
    1 root      20   0  2008  556  488 S    0  0.0   0:00.85 init               
    2 root      20   0     0    0    0 S    0  0.0   0:00.00 kthreadd           
    3 root      20   0     0    0    0 S    0  0.0   0:00.01 ksoftirqd/0        
    5 root       0 -20     0    0    0 S    0  0.0   0:00.00 kworker/0:0H       
    7 root       0 -20     0    0    0 S    0  0.0   0:00.00 kworker/u:0H       
    8 root      RT   0     0    0    0 S    0  0.0   0:00.00 migration/0        
    9 root      20   0     0    0    0 S    0  0.0   0:00.00 rcu_bh             
   10 root      20   0     0    0    0 S    0  0.0   0:00.08 rcu_sched          
   11 root      20   0     0    0    0 S    0  0.0   0:00.02 ksoftirqd/1        
   12 root      RT   0     0    0    0 S    0  0.0   0:00.00 migration/1        
   14 root       0 -20     0    0    0 S    0  0.0   0:00.00 kworker/1:0H       
   15 root       0 -20     0    0    0 S    0  0.0   0:00.00 cpuset             
   16 root       0 -20     0    0    0 S    0  0.0   0:00.00 khelper            
   17 root      20   0     0    0    0 S    0  0.0   0:00.00 kdevtmpfs          
   18 root       0 -20     0    0    0 S    0  0.0   0:00.00 netns              
  468 root      20   0     0    0    0 S    0  0.0   0:00.00 bdi-default        
  470 root       0 -20     0    0    0 S    0  0.0   0:00.00 kblockd            
More

Open in new window

VIRT is the 5th column. It describes the virtual size of the process, i.e. not just what's in memory but also what's paged out (to "Swap" - a very old name for the paging disk which dates back to when processes had to be swapped in and out of memory in their entirety - but I digress).
The output above shows that the init process has a virtual size of 2008 KB. If I had paged through further I would have seen other non-zero values. The default unit is kilobytes (K) - big enough processes are shown in megabytes with an M.
Just look and see what you can see. You could post the output if you prefer: top -b -n 1 >top.txt and post top.txt as a file attachment (Use Attach File link below text entry area).
0
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 
LVL 7

Expert Comment

by:expert1010
ID: 39200510
If you just want to run top sorted interactively (no batch mode with -b -n1) by VIRT you sould hit "F" and then "o" and return. You could also use "<" och ">" to move sorting around in the columns.
0
 

Author Comment

by:ittechlab
ID: 39241011
I am  trying to understand what is these field represent and how its help to make decision when doing performance tuning.

PR  NI  VIRT  RES  SHR S
0
 
LVL 34

Expert Comment

by:Duncan Roe
ID: 39242829
For a description of these fields, type man top. If or when you have done that, post any more specific questions you may have. You need a basic understanding of virtual memory and demand-paged architecture to make sense of some of them. I'll take a shot at explaining that a bit more if you like.
Your problem, however, still looks to me like a rogue application leaking (i.e. continually acquiring more) memory.
"performance tuning" is not going to help you one bit - in fact it very rarely helps anyone. What does help is identifying problem processes and doing something about them.
0
 

Author Comment

by:ittechlab
ID: 39366973
can you please let me know how do i get top 10 process which taking swap space by using command line instead of using top then shift O, i need to run a command line to list the first 10 process . This is for my script purpose.
0
 
LVL 34

Expert Comment

by:Duncan Roe
ID: 39373074
Good, you have found shift-o already. When you have got the order as you want using shift-o, write a .toprc file in your home directory by going back to running top then press shift-w.
After that, whenever you run top it will sort by swap file size. To get a static display of the top 10, run top for one sample in batch mode and crop the output by top -b -n 1|head -17|tail +8 (you may need to experiment with the numbers - they worked for me).
0
 

Author Closing Comment

by:ittechlab
ID: 39443468
better solution
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
RHEL7 - Error installing docker compose 2 219
Unix process listing into CSV format 3 87
SMTP log file for IMSVA 5 76
PartedMagic Secure Erase 14 33
Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question