加入收藏 | 设为首页 | 会员中心 | 我要投稿 济源站长网 (https://www.0391zz.cn/)- 数据工具、数据仓库、行业智能、CDN、运营!
当前位置: 首页 > 服务器 > 搭建环境 > Linux > 正文

18 Command Line Tools to Monitor Linux Performance

发布时间:2021-01-24 10:55:30 所属栏目:Linux 来源:网络整理
导读:By? ?Under:? ,? ?On:? December 26,2013 It’s really very tough job for every? System ?or? Network ?administrator to monitor and debug Linux System Performance ?problems every day. After being a? Linux Administrator ?for? 5 years ?in? IT in
副标题[/!--empirenews.page--]

By??Under:?,??On:?December 26,2013

It’s really very tough job for every?System?or?Network?administrator to monitor and debugLinux System Performance?problems every day. After being a?Linux Administrator?for?5 years?in?IT industry,I came to know that how hard is to monitor and keep systems up and running. For this reason,we’ve compiled the list of?Top 18?frequently used command line monitoring tools that might be useful for every?Linux/Unix System Administrator. These commands are available under all flavors of?Linux?and can be useful to monitor and find the actual causes of performance problem. This list of commands shown here are very enough for you to pick the one that is suitable for your monitoring scenario.

<p class="wp-caption-text">Linux Command Line Monitoring

1. Top – Linux Process Monitoring

Linux?Top?command is a performance monitoring program which is used frequently by many system administrators to monitor Linux performance and it is available under manyLinux/Unix?like operating systems. The top command used to dipslay all the running and active real-time processes in ordered list and updates it regularly. It display?CPU usage,Memory usage,?Swap Memory,?Cache Size,?Buffer Size,?Process PID,?User,?Commands and much more. It also shows high?memory?and?cpu?utilization of a running processess. The top command is much userful for system administrator to monitor and take correct action when required. Let’s see top command in action.

# top

<p class="wp-caption-text">Top Command Example

For more examples of Top command read :?

2. VmStat – Virtual Memory Statistics

Linux?VmStat?command used to display statistics of?virtual memory,?kernerl threads,disks,?system processes,?I/O blocks,?interrupts,?CPU activity?and much more. By default vmstat command is not available under Linux systems you need to install a package calledsysstat?that includes a vmstat program. The common usage of command format is.

# vmstat

procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu-----
r b swpd free inact active si so bi bo in cs us sy id wa st
1 0 0 810420 97380 70628 0 0 115 4 89 79 1 6 90 3 0

For more Vmstat examples read :?

3. Lsof – List Open Files

Lsof?command used in many?Linux/Unix?like system that is used to display list of all the open files and the processes. The open files included are?disk files,?network sockets,pipes,?devices?and?processes. One of the main reason for using this command is when a disk cannot be unmounted and displays the error that files are being used or opened. With this commmand you can easily identify which files are in use. The most common format for this command is.

# lsof

COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
init 1 root cwd DIR 104,2 4096 2 /
init 1 root rtd DIR 104,2 4096 2 /
init 1 root txt REG 104,2 38652 17710339 /sbin/init
init 1 root mem REG 104,2 129900 196453 /lib/ld-2.5.so
init 1 root mem REG 104,2 1693812 196454 /lib/libc-2.5.so
init 1 root mem REG 104,2 20668 196479 /lib/libdl-2.5.so
init 1 root mem REG 104,2 245376 196419 /lib/libsepol.so.1
init 1 root mem REG 104,2 93508 196431 /lib/libselinux.so.1
init 1 root 10u FIFO 0,17 953 /dev/initctl

More lsof command usage and examples :?

4. Tcpdump – Network Packet Analyzer

Tcpdump?one of the most widely used command-line?network packet analyzer?or?packets sniffer?program that is used capture or filter?TCP/IP?packets that received or transferred on a specific interface over a network. It also provides a option to save captured packages in a file for later analysis. tcpdump is almost available in all major Linux distributions.

# tcpdump -i eth0

tcpdump: verbose output suppressed,use -v or -vv for full protocol decode
listening on eth0,link-type EN10MB (Ethernet),capture size 96 bytes
22:08:59.617628 IP tecmint.com.ssh > 115.113.134.3.static-mumbai.vsnl.net.in.28472: P 2532133365:2532133481(116) ack 3561562349 win 9648
22:09:07.653466 IP tecmint.com.ssh > 115.113.134.3.static-mumbai.vsnl.net.in.28472: P 116:232(116) ack 1 win 9648
22:08:59.617916 IP 115.113.134.3.static-mumbai.vsnl.net.in.28472 > tecmint.com.ssh: . ack 116 win 64347

For more tcpdump usage read :?

5. Netstat – Network Statistics

(编辑:济源站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

热点阅读