服务器状态分析
#查看CPU的信息
- [root@host~]#cat/proc/cpuinfo
#查看物理CPU的个数
- [root@host/]#cat/proc/cpuinfo|grep"physicalid"|sort|uniq|wc-l
#查看每个物理CPU的核数
- [root@host/]#cat/proc/cpuinfo|grep"cpucores"|uniq
#逻辑CPU的个数(逻辑CPU = 物理CPU个数*核数)
- [root@host/]#cat/proc/cpuinfo|grep"processor"|wc-l
#查看内存使用情况
- [root@host~]#free-m
- totalusedfreesharedbufferscached
- Mem:372256115017158
- -/+buffers/cache:81290
- Swap:5090509
>total:内存总数
>user:已使用内存数
>free:空闲内存数
>shared:多进程共享内存数
>buffers:缓冲内存数
>cached:缓存内存数
可用内存 = free+buffers+cached
已用内存 = used-buffers-cached
swap 交换内存数,此项可判断内存是否够用的标准
#查看硬盘及分区信息
- fdisk-l
- [root@host~]#fdisk-l
- Disk/dev/sda:10.7GB,10737418240bytes
- 255heads,63sectors/track,1305cylinders
- Units=cylindersof16065*512=8225280bytes
- DeviceBootStartEndBlocksIdSystem
- /dev/sda1*11310439183Linux
- /dev/sda21478522112+82Linuxswap/Solaris
- /dev/sda37913059855877+83Linux
#检查文件系统的磁盘空间占用情况
df -h
- [root@host~]#df-h
- FilesystemSizeUsedAvailUse%Mountedon
- /dev/sda39.2G6.4G2.3G74%/
- /dev/sda199M12M82M13%/boot
- tmpfs187M0187M0%/dev/shm
- /dev/hdc4.1G4.1G0100%/mnt
#查看硬盘的I/O性能
- [root@host/]#iostat-d-x-k15
- #iostaat是含在套装systat中,在CentOs5.5用命令yum-yinstallsysstat来安装
I/0
- [root@host/]#uptime
- 12:39:12up2:50,3users,loadaverage:0.00,0.03,0.00
- [root@host/]#w
- 12:39:59up2:50,3users,loadaverage:0.00,0.03,0.00
- USERTTYFROMLOGIN@IDLEJCPUPCPUWHAT
- roottty1-09:5332:170.36s0.36s-bash
- rootpts/0192.168.1.10210:231:54m0.03s0.03s-bash
- rootpts/1192.168.1.10512:160.00s0.09s0.02sw
整体性能
- [root@host/]#vmstat14
- procs———–memory————-swap——-io——system——-cpu——
- rbswpdfreebuffcachesisobiboincsussyidwast
- 0005046450096101356002113925183009910
- 00050464500961013800000830180010000
- 00050464500961013800000833270010000
- 00050464501041013720003282227009910
#proces r:等待运行的进程数 b:非中断睡眠状态的进程数 w:被交换出去的可运行进程数
#memory swpd:虚拟内存使用情况 fres:空闲的内存 buff:用作缓存的内存数(单位:KB)
#swap si:从磁盘交换到内存的交换页数量 so:从内存交换到磁盘的交换页数量(单位:kb/秒)
#io bi:发送到块设备的块数 bo:从块设备接收到的块数(单位:块/秒)
#system in:每秒的中断数,包括时钟中断 cs:每秒的环境(上下文)切换数
#cpu us:CPU使用时间 sy:CPU系统使用时间 id:闲置时间(单位:百分比)
标准情况下:r小于5,b约为0
如果user + sys 小于70 表示系统性能较好;如果大于等于85以上,表示性能比较糟糕
查看系统内核的版本号
- [root@host/]#uname-a
- Linuxhost.domain.com2.6.18-194.el5#1SMPFriApr214:58:14EDT2010x86_64x86_64x86_64GNU/Linux
- [root@host/]#uname-r
- 2.6.18-194.el5
查看系统32位还是64位
- [root@host/]#ls-1F/|grep/$
- 查找是否有/lib64,有则系统为64位
- 另一种查看系统32位还是64位
- [root@host/]#file/sbin/init
- /sbin/init:ELF64-bitLSBexecutable,AMDx86-64,version1(SYSV),forGNU/Linux2.6.9,dynamicallylinked(usessharedlibs),forGNU/Linux2.6.9,stripped
- [root@host/]#lsb_release-a
- LSBVersion::core-3.1-amd64:core-3.1-ia32:core-3.1-noarch:graphics-3.1-amd64:graphics-3.1-ia32:graphics-3.1-noarch
- DistributorID:CentOS
- Description:CentOSrelease5.5(Final)
- Release:5.5
- Codename:Final
查看系统已载入的相关模块
- [root@host/]#lsmod|grepip
- ipv643536124
- xfrm_nalgo433331ipv6
- dm_multipath569200
- scsi_dh421771dm_multipath
- dm_mod1016494dm_mirror,dm_multipath,dm_raid45,dm_log
在linux下查看PCI设置,lspci命令能列出机器中的PCI信息,比如声卡、显卡、Modem
- [root@host/]#lspci|grepEther
- 02:01.0Ethernetcontroller:IntelCorporation82545EMGigabitEthernetController(Copper)(rev01)
原文链接:https://www.toutiao.com/a6604596474200195597/
相关文章
- 64M VPS建站:是否适合初学者操作和管理? 2025-06-10
- ASP.NET自助建站系统中的用户注册和登录功能定制方法 2025-06-10
- ASP.NET自助建站系统的域名绑定与解析教程 2025-06-10
- 个人服务器网站搭建:如何选择合适的服务器提供商? 2025-06-10
- ASP.NET自助建站系统中如何实现多语言支持? 2025-06-10