Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Detailed explanation of Linux server status and performance-related commands

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Server status analysis

View Linux server CPU details

# View the information of CPU

[root@host ~] # cat / proc/cpuinfo

# check the number of physical CPU

[root@host /] # cat / proc/cpuinfo | grep "physical id" | sort | uniq | wc-l

# check the number of cores for each physical CPU

[root@host /] # cat / proc/cpuinfo | grep "cpu cores" | uniq

# number of logical CPU (logical CPU = number of physical CPU * cores)

[root@host /] # cat / proc/cpuinfo | grep "processor" | wc-l

Check the memory of the Linux server

# View memory usage

[root@host] # free-m total used free shared buffers cached Mem: 372 256 115 0 17 158-/ + buffers/cache: 81 290 Swap: 509 0509

> total: total memory

> user: number of memory used

> free: number of free memory

> shared: number of memory shared by multiple processes

> buffers: number of buffered memory

> cached: number of cache memory

Available memory = free+buffers+cached

Used memory = used-buffers-cached

The number of swap swap memory, which can be used to determine whether the memory is sufficient.

View Linux server hard drive usage

# View hard disk and partition information

Fdisk-l

[root@host] # fdisk-l Disk / dev/sda: 10.7 GB, 10737418240 bytes 255heads, 63 sectors/track, 1305 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System / dev/sda1 * 1 13 104391 83 Linux / dev/sda2 14 78 522112 + 82 Linux swap / Solaris / dev/sda3 79 1305 9855877 + 83 Linux # check the disk space occupancy of the file system

Df-h

[root@host ~] # df-h Filesystem Size Used Avail Use% Mounted on / dev/sda3 9.2G 6.4G 2.3G 74% / dev/sda1 99M 12M 82m 13% / boot tmpfs 187M 0187m 0% / dev/shm / dev/hdc 4.1G 4.1G 0100% / mnt

Server performance analysis

# check the Istroke O performance of the hard disk

[root@host /] # iostat-d-x-k 1 5

# iostaat is included in the package systat and installed in CentOs5.5 with the command yum-y install sysstat

I/0

View the average load of the Linux server

[root@host /] # uptime 12:39:12 up 2:50, 3 users, load average: 0.00, 0.03, 0.00

[root@host /] # w 12:39:59 up 2:50, 3 users, load average: 0.00,0.03,0.00 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT root tty1-09:53 32:17 0.36s 0.36s-bash root pts/0 192.168.1.102 10:23 1vy 54m 0.03s 0.03s-bash root pts/1 192.168.1.105 12:16 0.00s 0.09s 0.02s w

Monitor the overall performance of the Linux server

Overall performance

[root@host /] # vmstat 1 4 procs-memory- swap---io---- system---cpu- r b swpd free buff cache si so bi bo in cs us sy id wa st 00 50464 50096 101356 00 21 13 925 1883 00 99 100 50464 50096 101380 00 00 830 18 00 100 0 00 00 50464 50096 101380 00 00 833 27 00 100 00 00 0 50464 50104 101372 00 0 32 822 27 00 99 10

# proces r: number of processes waiting to run b: number of processes in uninterrupted sleep state w: number of runnable processes swapped out

# memory swpd: virtual memory usage fres: free memory buff: number of memory used as cache (in KB)

# swap si: number of swap pages swapped from disk to memory so: number of swapping pages swapped from memory to disk (in kb/ seconds)

# io bi: number of blocks sent to the block device bo: number of blocks received from the block device (in blocks / second)

# system in: interrupts per second, including clock interrupts cs: environment (context) switches per second

# cpu us:CPU usage time sy:CPU system usage time id: idle time (in percentage)

In standard cases, r is less than 5 and b is about 0

If user + sys is less than 70, the system performance is good; if it is greater than or equal to 85, the performance is poor.

View other parameters of the Linux server

Check the version number of the system kernel

[root@host /] # uname-a Linux host.domain.com 2.6.18-194.el5 # 1 SMP Fri Apr 2 14:58:14 EDT 2010 x86 "64 GNU/Linux [root@host /] # uname-r 2.6.18-194.el5

Check whether the system is 32-bit or 64-bit

[root@host /] # ls-1F / | grep / $

Find out if there is / lib64, and if so, the system is 64-bit

Another way to view the system is 32-bit or 64-bit.

[root@host /] # file / sbin/init / sbin/init: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, stripped

View information about the Linux distribution used by the server

[root@host /] # lsb_release-a LSB Version:: core-3.1-amd64:core-3.1-ia32:core-3.1-noarch:graphics-3.1-amd64:graphics-3.1-ia32:graphics-3.1-noarch Distributor ID: CentOS Description: CentOS release 5.5 (Final) Release: 5.5 Codename: Final

View the relevant modules loaded by the system

[root@host /] # lsmod | grep ip ipv6 435361 24 xfrm_nalgo 43333 1 ipv6 dm_multipath 56920 0 scsi_dh 42177 1 dm_multipath dm_mod 101649 4 dm_mirror,dm_multipath,dm_raid45,dm_log

By viewing the PCI settings under linux, the lspci command lists the PCI information in the machine, such as sound card, video card, and Modem.

[root@host /] # lspci | grep Ether 02grep Ether 01.0 Ethernet controller: Intel Corporation 82545EM Gigabit Ethernet Controller (Copper) (rev 01)

Summary

The above is the Linux server status, performance-related commands introduced to you by the editor. I hope it will be helpful to you. If you have any questions, please leave me a message and the editor will reply you in time. Thank you very much for your support to the website!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report