Chinaunix首页 | 论坛 | 博客
  • 博客访问: 386536
  • 博文数量: 25
  • 博客积分: 496
  • 博客等级: 下士
  • 技术积分: 815
  • 用 户 组: 普通用户
  • 注册时间: 2011-09-01 11:18
文章分类
文章存档

2014年(2)

2013年(6)

2012年(17)

分类: LINUX

2012-07-13 09:06:56

    前几天发了一篇“记一次linux服务器性能优化【分析篇】”:
    这两天试了一下还是没法模拟我当时的环境,就我把我服务器调整后的状态贴出来,给大家一个参考,另外大家也帮忙看看我服务器还有那些性能问题,欢迎指出。
    服务器状态读取的方法:
    通过shell脚本在服务器负载超过10的时候收集服务器状态信息,现在这台服务器负载一般在10以内

点击(此处)折叠或打开

  1. #!/bin/bash
  2. while true;do
  3. LOAD=`uptime |awk '{print $10}'|awk -F"," '{print $1}'|awk -F"." '{print $1}'`
  4. if [ "$LOAD" -ge "10" ];then
  5. echo "########## top ##########" >>/tmp/test.log
  6. top -n 3 >>/tmp/test.log
  7. echo "########## vmstat ##########" >>/tmp/test.log
  8. vmstat 1 10 >>/tmp/test.log
  9. echo "########## iostat ##########" >>/tmp/test.log
  10. iostat -x 1 5 >>/tmp/test.log
  11. echo "########## ifstat ##########" >>/tmp/test.log
  12. ifstat 1 10 >>/tmp/test.log
  13. echo "########## free ##########" >>/tmp/test.log
  14. free -m >>/tmp/test.log
  15. break
  16. else
  17. sleep 3
  18. fi
  19. done
nfs进程数:

点击(此处)折叠或打开

  1. [root@node1.example.com ~]# ps -ef |grep nfs|wc -l
  2. 163
top信息,排版有点乱了:

点击(此处)折叠或打开

  1. top - 17:14:50 up 26 days, 2:03, 2 users, load average: 10.83, 6.56, 5.01
  2. Tasks: 675 total, 1 running, 674 s 0 Sleeping, 0 stopped, 0 zombie
  3. Cpu(s): 0.1%us, 1.5%sy, 0.0%ni,97.2%id, 0.2%wa, 0.0%hi, 1.0%si, 0.0%st
  4.  2.0 0.0 42:56.64 nfsd
  5. 0 S 2.0 0.0 44:33.41 nfsd
  6. 0 0 0 S 0.0 0.0 59:11.27 ksoftirqd/5
  7. PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
  8. 29312 root 15 0 0 0 0 S 5.6 0.0 43:29.71 nfsd
  9. 59826268k cached
  10. 29359 root 15 0 0 0 0 S 3.6 0.0 42:56.75 nfsd
  11. root 15 0 0 0 0 S 1.6 0.0 43:29.54 nfsd
  12. 29294 root 15 0 0 0 0 S 3.0 0.0 43:36.88 nfsd
  13. root 15 0 0 0 0 S 1.6 0.0 42:54.01 nfsd
  14. 29309 root 15 0 0 0 0 S 3.0 0.0 46:02.95 nfsd
  15. root 15 0 0 0 0 S 1.6 0.0 45:41.01 nfsd
  16. 29307 root 15 0 0 0 0 S 2.6 0.0 45:54.53 nfsd
  17. root 16 0 13140 1568 808 S 1.3 0.0 0:08.75 top
  18. 29336 root 15 0 0 0 0 S 2.6 0.0 43:25.68 nfsd
  19. root 15 0 0 0 0 S 1.3 0.0 41:38.62 nfsd
  20. 24 root 35 19 0 0 0 S 2.3 0.0 29:10.30 ksoftirqd/7
  21. root 34 19 0 0 0 S 1.0 0.0 720:00.68 kipmi0
  22. 29399 root 15 0 0 0 0 S 2.3 0.0 42:22.31 nfsd
  23. root 14 -1 114m 1884 1460 S 0.7 0.0 33:08.94 modclusterd
  24. 29431 root 15 0 0 0 0 S 2.3 0.0 41:38.69 nfsd
  25. root 34 19 0 0 0 S 0.3 0.0 29:10.23 ksoftirqd/7
  26. 29327 root 15 0 0 0 0 S 2.0 0.0 48:11.78 nfsd
  27. root 18 0 65956 1232 1024 S 0.3 0.0 11:31.35 ping.sh
  28. 29363 root 15 0 0 0 0 S 2.0 0.0 42:54.07 nfsd
  29. root 10 -5 0 0 0 S 0.3 0.0 6:45.87 dlm_astd
  30. root 15 0 0 0 0 S 0.3 0.0 42:22.24 nfsd
  31. 29400 root 15 0 0 0 0 S 2.0 0.0 44:33.47 nfsd
  32. root 15 0 10348 688 580 S 0.0 0.0 0:05.57 init
  33. 29422 root 15 0 0 0 0 S 2.0 0.0 44:59.68 nfsd
  34. root RT -5 0 0 0 S 0.0 0.0 0:05.64 migration/0
  35. 24192 root 16 0 13140 1568 808 S 1.6 0.0 0:08.80 top
  36. root 34 19 0 0 0 S 0.0 0.0 0:00.03 ksoftirqd/0
  37. 29304 root 15 0 0 0 0 S 1.6 0.0 42:56.77 nfsd
  38. root RT -5 0 0 0 S 0.0 0.0 0:00.00 watchdog/0
  39. 29356 root 15 0 0 0 0 S 1.6 0.0 43:06.90 nfsd
  40. root RT -5 0 0 0 S 0.0 0.0 0:04.08 migration/1
  41. 29433 root 15 0 0 0 0 S 1.6 0.0 41:20.85 nfsd
  42. root 34 19 0 0 0 S 0.0 0.0 31:54.68 ksoftirqd/1
  43. 29437 root 15 0 0 0 0 S 1.6 0.0 45:41.06 nfsd
  44. root RT -5 0 0 0 S 0.0 0.0 0:00.11 watchdog/1
  45. 26880 root 15 0 13140 1556 804 R 1.3 0.0 0:00.16 top
  46. RT -5 0 0 0 S 0.0 0.0 0:00.10 migration/2
  47. 29409 root 15 0 0 0 0 S 1.3 0.0 40:58.08 nfsd
  48. root 34 19 0 0 0 S 0.0 0.0 0:01.21 ksoftirqd/2
  49. 8037 root 34 19 0 0 0 S 1.0 0.0 720:00.71 kipmi0
  50. root RT -5 0 0 0 S 0.0 0.0 0:00.00 watchdog/2
  51. 10269 root RT 0 177m 79m 53m S 0.3 0.1 113:02.25 ai***ec
  52. root RT -5 0 0 0 S 0.0 0.0 0:00.98 migration/3
  53. 24174 root 16 0 90100 3288 2532 S 0.3 0.0 0:09.05 sshd
vmstat信息:

iostat信息:

ifstat信息:

free信息:

    这个状态服务器还不是很忙,当客户端有大程序跑的时候,这台服务器内存会被耗光,网络流量在110M/s左右,io占满,这个时候服务器负载在25-30之间。
    nfs服务给我的感觉是消耗内存、网络、io,对CPU要求不高。
每个人应用的环境不一样,得出的结论可能也不一样,欢迎拍砖:>


阅读(2476) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~