AD

look at how the actual network card under linux traffic

Look at the actual flow in the linux sar's really a good choice. ethtool should be able to see the rate card, and I try again.

# Sar-n DEV-u 1 10
Look at the current network traffic

I went online to find articles to use sar articles:

Using the UNIX operating system, we often use a variety of problems, such as system speed suddenly slow down, crash or system easily carried by the host terminal often crash, then we often guess, is hard space is too small, or memory? I / O bottlenecks, or the core of the system parameters of a problem? At this time, we should consider using the system provided us with the sar command to make an understanding of the system, the command is an important tool for system maintenance, primarily to help us master the use of system resources, especially memory and CPU usage is UNIX system users should be one of the tools to master. sar command line commonly used formats:

sar [options] [-A] [-o file] t [n]

The command line, n and t together define the two parameters and frequency of sampling interval, t is the sampling interval, must be some parameters, n is the sample number is optional, default is 1,-o file that will command results in binary format stored in the file, file is not the key here is the file name. options for the command-line options, sar command options are many, following only lists the common options:

-A: the sum of all reports. -U: CPU utilization-v: the process, I node, files, and lock table state. -D: disk usage reports. -R: unused memory pages and disk blocks. -G: Serial I / O situation. -B: buffer usage. -A: file read and write conditions. -C: system call situation. -R: process activities. -Y: terminal device activities. -W: system switching activity.

The following will illustrate.

Example One: Using the command line sar-utn

For example, sampling once every 60 seconds, continuous sampling five times to observe the CPU usage, and the sampling results in binary form into the current directory under the file zhou, the need to type the following command:

# Sar-u-o zhou 60 5

Display:

SCO_SV scosysv 3.2v5.0.5 i80386 10/01/2001 14:43:50% usr% sys% wio% idle (-u) 14:44:50 0 1 4 94 14:45:50 0 2 4 93 14:46 : 50 0 2 2 96 14:47:50 0 2 5 93 14:48:50 0 2 2 96 Average 0 2 4 94

In the show include:

% Usr: CPU in user mode, the percentage of time. % Sys: CPU in system mode, the percentage of time. % Wio: CPU time to wait for the completion percentage of input and output. % Idle: CPU idle time percentage.

In all of the shows, we should mainly pay attention to% wio and% idle,% wio value is too high to drive an I / O bottlenecks,% idle value is high, the CPU than the idle, but if the high value of% idle slow system response , it is possible to wait for the CPU to allocate memory, you should increase the memory capacity. % Idle value is less than 10 if it continues, then the system's CPU processing power is relatively low, indicating that the most urgent needs of the system resources are CPU.

If you want to view the contents of binary file zhou, you need to type the following sar command:

# Sar-u-f zhou

Visible, sar command that can be real-time sampling, but also the results of previous sampling query.

Example 2: Using the command line sar-vtn

For example, sampling once every 30 seconds, continuous sampling five times to observe the state of the core table, need to type the following command:

# Sar-v 30 5

Display: SCO_SV scosysv 3.2v5.0.5 i80386 10/01/2001 10:33:23 proc-sz ov inod-sz ov file-sz ov lock-sz (-v) 10:33:53 305 / 321 0 1337 / 27640 1561/1706 040 / 12810:34:23 308 / 3210 1340/2764 1587/1706 0 0 37 / 128 10:34:53 305 / 3210 1332/2764 1565/1706 0 0 36 / 12810:35 : 23 308 / 3210 1338/2764 1592/1706 0 0 37 / 12810:35:53 308 / 3210 1335/2764 1591/1706 0 0 37 / 128 display include:

proc-sz: currently being used in the core or distribution process table entry number, from the core parameters MAX-PROC control.

inod-sz: the core is currently being used or allocated for the i-node table entry number, from the core parameters MAX-INODE control.

file-sz: the core is currently being used or the file allocation table entry number, from the core parameters MAX-FILE control.

ov: overflow occurrences.

Lock-sz: the core is currently being used or allocated record number of lock table entries, from the core parameters MAX-FLCKREC control.

Display format

Actual entry / number of entries that can be used

Display the contents of said core with completely normal, three tables no overflow, the core parameters need adjustment, if there is overflow, the core parameters to be adjusted accordingly, will increase the number of corresponding entries.

Example Three: Using the command line sar-dtn

For example, sampling once every 30 seconds, continuous sampling five times, report the use of equipment, the need to type the following command:

# Sar-d 30 5

Display:

SCO_SV scosysv 3.2v5.0.5 i80386 10/01/200111: 06:43 device% busy avque r + w / s blks / s avwait avserv (-d) 11:07:13 wd-0 1.47 2.75 4.67 14.73 5.50 3.1411:07 : 43 wd-0 0.43 18.77 3.07 8.66 25.11 1.4111:08:13 wd-0 0.77 2.78 2.77 7.26 4.94 2.7711:08:43 wd-0 1.10 11.18 4.10 11.26 27.32 2.6811:09:13 wd-0 1.97 21.78 5.86 34.06 69.66 3.35 Average wd-0 1.15 12.11 4.09 15.19 31.12 2.80

The display includes:

device: sar command is monitoring the block device name. % Busy: device is busy, the percentage of time a transfer request. avque: when the queue was full, the average number of outstanding requests. r + w / s: second to the device or the amount of outgoing data from the device. blks / s: number of blocks transferred per second, each 512 bytes. avwait: send request queue when the queue fills, the average idle time avserv: the average time required to complete a transfer request (ms).

In the show's content, wd-0 is a hard name,% busy value is relatively small, indicating that the effective transmission of requests to handle too little time, the file system is not efficient, in general,% busy value is higher, avque value lower, more efficient file system, if the% busy and avque value is relatively high, the hard disk transfer speed is too slow, need to be adjusted.

Example Four: Using the command line sar-btn

For example, sampling once every 30 seconds, continuous sampling five times, report the use of the buffer required to type the following command:

# Sar-b 30 5

Display:

SCO_SV scosysv 3.2v5.0.5 i80386 10/01/200114: 54:59 bread / s lread / s% rcache bwrit / s lwrit / s% wcache pread / s pwrit / s (-b) 14:55:29 0 147 100 521 780 014:55:59 0186100525790 014:56:29 423298858860 014:56:59 0125100523760 014:57:29 089,100,412 66 0 0Average 1 156 99 5 28 80 0 0

The display includes:

bread / s: read from disk per second buffer into the buffer system of physical blocks. lread / s: the average per second read out from the system buffer logic blocks. % R** in the buffer cache in the percentage of logical read. bwrit / s: the average per second from the system buffer written to physical disk blocks. lwrit / s: the system per second write buffer logic blocks. % W** in the buffer cache in the percentage of logical read. pread / s: average number of physical read requests per second. pwrit / s: average number of physical write requests per second.

In the show's content, the most important thing is% cache and% wcache two, their values ​​reflect the efficient use of buffer,% rcache value of less than 90% wcache value or less than 65, the buffer system should be increased number, buffer number from the core parameters NBUF control, so that about 90% rcache,% wcache 80 or so. However, the number of buffer parameters affect I / O efficiency, increase buffer, should be the case in the larger memory, but otherwise the system efficiency is not improved.

Example 5: Use command line sar-gtn

For example, sampling once every 30 seconds, continuous sampling five times, reports the serial I / O, operating conditions, the need to type the following command:

# Sar-g 30 5

Display:

SCO_SV scosysv 3.2v5.0.5 i80386 11/22/200117: 07:03 ovsiohw / s ovsiodma ​​/ s ovclist / s (-g) 17:07:33 0.00 0.00 0.0017:08:03 0.00 0.00 0.0017:08:33 0.00 0.00 0.0017:09:03 0.00 0.00 0.0017:09:33 0.00 0.00 0.00Average 0.00 0.00 0.00

The display includes:

ovsiohw / s: second in the serial I / O hardware overflow occurs.

ovsiodma ​​/ s: second in the serial I / O channel direct input and output cache overflow occurs.

ovclist / s: there's an overflow queue characters per second.

In the displayed content, the value of each column is zero, indicating that the sampling time, the system does not occur serial I / O overflow.

Many use the sar command, and sometimes determine a problem and needs to use some combination of the sar command, for example, suspect CPU bottlenecks, and can be sar-u sar-q run, suspect I / O bottlenecks, use sar-b, sar-u and sar-d point of view, the five cases cited above is just one part of a friend might be interested in

ifstat compact easy to use:

[Root @ test1 root] # ifstat
eth0 eth1
KB / s in KB / s out KB / s in KB / s out
1.55 2.73 0.00 0.00
1.33 2.48 0.00 0.00
0.92 2.33 0.00 0.00
1.01 2.05 0.00 0.00
0.89 1.43 0.00 0.00
0.95 1.90 0.00 0.00
1.33 2.82 0.00 0.00
1.50 3.65 0.00 0.00
0.98 1.96 0.00 0.00
1.06 2.33 0.00 0.00
标签: network traffic, command options, system parameters, cpu utilization, command line options, unused memory, current network, cpu usage, memory pages, unix system users, system speed, disk blocks, unix operating system, terminal device, sampling results, sar command, sampling interval, continuous sampling, hard space, host terminal
分类: OS
时间: 2010-10-13

相关文章

  1. bind more than one network card ip linux

    Linux network card bound to a method of multiple IP 1.Redhat series (redhat, Fedora Core, Centos) method assum ...
  2. More than one network card under Linux to bind multiple network cards share a single IP and IP

    Under Linux sometimes need a network card to bind multiple IP, this article describes Redhat series (redhat, F ...
  3. a network card under linux configure multiple IP

    Text console below netconfig, there are tools ifconfig, netconfig convenient graphical slightly, but not the d ...
  4. Linux network card detection and setting

    This is my depressing thing at least a week, write to you, as you accumulate experience points, anyway, I was ...
  5. Configure network card and restart

    Reprinted from: http://blog.sina.com.cn/s/blog_4b0a62670100921z.html In the Linux environment, configure the c ...
  6. Ubuntu's network card configuration under the fixed ip

    Source: linux Corporation Ubuntu fixed ip network card configuration under preparation under the vi command mu ...
  7. Wireless network card to the outside network and the general internal network card associated

    If the machine has two network cards, one is wireless, one is normal, then the XP system, the default is an or ...
  8. Linux boot network card

    Linux ifconfig command can be used to view the activities of NIC and IP address, subnet mask, or mac address a ...
  9. fedora 12 wireless network card under the lamp light thinkpad r61i

    Is already in my thinkpad downloading the fedora12, has been used in the present, but one has not been resolve ...
  10. Question: Why wireless network card can not send data?

    All of the testing process that the program has successfully created a new data packet, then call NdisFSendNet ...
  11. Add virtual network card AIX

    1> delete ent0 & ent1 card method (in ent0 example): Bring the interface down: # Ifconfig en0 down Dele ...
  12. VisualBox virtual machine network card driver download XP System

    Emphasis in original XPSP3 system back up out of the AMD PCNET Family Ethernet Adapter (PCI) network card driv ...
  13. Easily remove computer "shadow network card"

    In the computer's "Device Manager", many people behind the name card, "# 2", "# 3&quo ...
  14. Wireless network card can not find the problem

    Phenomenon: BENQ Joybook C42 Wireless Internet can not find. 1, My Network Places -> Properties, and only t ...
  15. centos system Broadcom BCM5709 network card does not work

    Reality today received notice that the server services down, because the outside can not see, after a while my ...
  16. Bind more than one network card with static IP routing

    System Environment: CentOS 5 1, bind more than one network card IP Build configuration file ifcfg-ethX-rangeX: ...
  17. AIX see if network card is bound to do

    Can be done lsattr command to see whether the network card bound, just for the record the following Quote # Ls ...
  18. ubuntu 9.10 wireless network card driver installation SL410

    Hardware: thinkpad t400 11b/g/n Wireless LAN Mini-PCI Express Adapter II Software: ubuntu 9.10 2.6.31-16 Drive ...
  19. redhat linux network card a fixed ip setting

    redhat linux network card a fixed ip setting Before xwindow under redhat-config-network to set a fixed ip netw ...