Linux优化

来源:互联网 发布:pump it up 2004 编辑:程序博客网 时间:2024/06/11 13:38

磁盘

df -l

查看硬盘使用情况

详情请看磁盘管理http://blog.csdn.net/xuansiyu/article/details/28867065

 

-------------------------------------

ps 进程

查看ora进程

ps -ef|grep ora

 

kill -9 进程号

批量杀ora进程

kill -9 `ps -ef |grep ora | grep -v gep |awk ' {print $2}'`

 

-------------------------------------

内存

free -m

[oracle@hngdcrm xxx]$ free -m
             total       used       free     shared    buffers     cached
Mem:         16042       7233       8808          0         48       6442
-/+ buffers/cache:        742      15299
Swap:         5951          0       5951

主要看Swap

 

 

-------------------------------------

 

vmstat

 

[oracle@hngdcrm xxx]$ vmstat 1 5  1秒钟刷新一次,5次循环
procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 0  0      0 9023016  50644 6600624    0    0    42    47    0    6  9  1 86  3  0
 0  0      0 9022892  50644 6600648    0    0     0     0 1083  572  1  1 99  0  0
 0  0      0 9022892  50644 6600648    0    0     4   108 1098  609  6  1 92  1  0
 0  0      0 9023404  50644 6600652    0    0     4    28 1096  806 11  2 87  1  0
 0  0      0 9023404  50652 6600644    0    0     4   208 1117  674 11  1 86  1  0

 

看swap的换页频率

-------------------------------------------------------------------------------------------------

 

top

[oracle@hngdcrm xxx]$ top
top - 15:55:18 up 17 days, 11:31,  2 users,  load average: 1.64, 0.67, 0.64
Tasks: 276 total,   1 running, 275 sleeping,   0 stopped,   0 zombie
Cpu(s):  9.7%us,  1.2%sy,  0.0%ni, 88.5%id,  0.7%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:  16427416k total,  7416424k used,  9010992k free,    51252k buffers
Swap:  6094840k total,        0k used,  6094840k free,  6602228k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                       
 1867 oracle    15   0 12872 1236  808 R  0.3  0.0   0:00.04 top                            
    1 root      15   0 10348  684  576 S  0.0  0.0   3:26.32 init                           
    2 root      RT  -5     0    0    0 S  0.0  0.0   0:00.00 migration/0                    
    3 root      34  19     0    0    0 S  0.0  0.0   0:00.55 ksoftirqd/0                    
    4 root      RT  -5     0    0    0 S  0.0  0.0   0:00.00 watchdog/0                     
    5 root      RT  -5     0    0    0 S  0.0  0.0   0:00.00 migration/1                    
    6 root      34  19     0    0    0 S  0.0  0.0   0:00.28 ksoftirqd/1                    
    7 root      RT  -5     0    0    0 S  0.0  0.0   0:00.00 watchdog/1                     
    8 root      RT  -5     0    0    0 S  0.0  0.0   0:00.00 migration/2  

 

设置:

 刷新频率 按s 输入秒数 默认3秒

分类排序:cpu百分率 按 P 内存使用百分率 M

-------------------------------------

0 0
原创粉丝点击