Skip to main content



FCP statistics (SLES8)

developerWorks

   HOWTO & tools

How to enable FCP statistics (2.4.21-251 and higher)
How to read FCP statistics
How to detect misses in FCP statistics
Sample tools for formatting FCP statistics data




Resource management tools help you monitor performance and identify performance issues. There are many ways to collect the system data you need to investigate performance problems.

The Linux kernel 2.4 version of the device driver for FCP provides some basic statistics of the I/O traffic pattern for SCSI devices for Linux on System z.

For Novell/SUSE kernel version 2.4.21-251 and higher the device driver gathers independent statistics for each FCP subchannel. Statistics are turned off by default and may be activated as described below.

Earlier versions of the device driver offer statistics data as a summation of corresponding requests across all FCP subchannels. It is all times active.

How to enable FCP statistics (2.4.21-251 and higher)

Statistics are turned off by default to allow maximum performance. Gathering statistical data decreases performance by about 2 percent. Enabling, disabling and resetting statistics can be achieved by using the following commands defined for the /proc file system interface from the device driver for FCP. Make sure to choose the correct /proc file system entry as indicated below.

  • Enable (turn data gathering on):
    echo stat on > /proc/scsi/zfcp/devno0x????/status
  • Disable (turn data gathering off and discard all statistical data collected so far):
    echo stat off > /proc/scsi/zfcp/devno0x????/status
  • Reset (either turn data gathering on, if disabled, or discard all statistical data collected so far without turning statistics off):
    echo stat reset > /proc/scsi/zfcp/devno0x????/status

where devno0x???? is the FCP device address.

Note: To use this interface, make sure that you have configured the corresponding FCP device in the zfcp device driver in /proc/scsi/zfcp/map.


Back to top


How to read FCP statistics

The statistical data are provided at the end of the file

  • /proc/scsi/zfcp/devno0x????/status for Novell/SUSE kernel version 2.4.21-251 and higher
    (the same HBA's /proc file system entry that you have used to enable statistics).
  • /proc/scsi/zfcp/mod_parm for earlier versions

The format of an entry is:

<tag> <value>:<occurrence>

where
<tag> ::= rr | wr
rr is a read request
wr is a write request

<value> is a 32 bit unsigned integer indicating a particular request size (printed in hexadecimal with padded zeros)

<occurrence> is a 32 bit unsigned integer indicating the number of requests of that size (printed in hexadecimal with padded zeros)

Usually the statistical data comprise a list of several entries, depending on the actual traffic pattern.
The list of entries is sorted by tag and occurrence.

Example:

rr 0x0000a800:0x00000007
is 7 read requests of 42 KB each

Back to top


How to detect misses in FCP statistics

It is very unlikely that FCP needs to omit portions of the statistical data due to resource constraints. Check the field "missed stats" in /proc/scsi/zfcp/devno0x????/status for the number of requests that could not be collected during the gathering of statistical data. It is recommended to make sure that the number of misses is very low, preferably zero, when FCP statistics are evaluated.


Back to top


Sample tools for formatting FCP statistics data

If you download any software from this web site please be aware of the Warranty Disclaimer and Limitation of Liability.

These sample tools assist you to handle the FCP statistics:

shows
  • the name of the files parsed for statistic data
  • the number of requests
  • the number of requests where portions of the statistical data are omitted (missed stats)
  • the number of requests which were delayed because the FCP subchannel's queues were full
  • the distribution of request sizes
Download fcpstats.tar.gz MD5
Additional scripts for easier handling: These scripts are for Linux version 2.4.21-251 and higher.
They are working on all devices found under /proc/scsi/zfcp/devno0x????
fcpstats_on.sh

switches statistics for all FCP subchannels on

fcpstats_off.sh

switches statistics for all FCP subchannels off

fcpstats_evaluate.sh

shows statistics data from all FCP subchannels

  • After download and extraction, perform the following command to make the tools executable for the Linux shell:
    chmod u+x fcpstats_on.sh fcpstats_off.sh fcpstats_evaluate.sh fcpstats.pl
  • You can use the scripts as templates to adapt them to your specific needs.
The base parser

Usage
./fcpstats.pl <file containing FCP statistics data> [<file containing FCP statistics data>]

For releases prior to 2.4.21-251: The statistics are available in /proc/scsi/zfcp/mod_parm
For release 2.4.21-251 and higher: The statistics are available in /proc/scsi/zfcp/devno0x????//status

Note: Every time FCP's statistics are read from the respective /proc file system file a new and current snapshot of data is produced. Depending on your needs it might be beneficial to create permanent copies of statistics snapshots by copying respective /proc file system files to a safe location, and to use the parser for off-line evaluation.

A formatted FCP statistics sample output

This is a sample output from a system with 4 FCP subchannels under a database workload on an ext2 file system. It shows the typical pattern of many 4KB requests, which corresponds to the page size used by the database. In this example, larger write requests occur as well since Linux might be able to merge cached buffers into an aggregated I/O request on their way out to a target device.

Other request sizes might be caused by the fact that the zfcp driver accounts any type of outbound or inbound I/O buffer, not only those associated with reading or writing data to disk. There are also other SCSI commands, like for communication between FCP adapter and disk devices. These requests are few and far between, and usually occur in the context of device detection or error recovery.

parsing /proc/scsi/zfcp/devno0x1706/status
parsing /proc/scsi/zfcp/devno0x1786/status

parsing /proc/scsi/zfcp/devno0x1806/status
parsing /proc/scsi/zfcp/devno0x50ee/status

device devno0x1706/status devno0x1786/status devno0x1806/status devno0x50ee/status
requests
6858406
6822876
6819385
6858359
missed stats
0
0
0
0
queue full
15063
8071
12296
7007
Size[KB] Write Read Write Read Write Read Write Read
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
2
0
0
0
0
0
0
0
0
3
0
0
0
0
0
0
0
0
4
1092678
5047642
1094364
5051776
1091385
5043192
1091047
5044008
5
0
0
0
0
0
0
0
0
6
0
0
0
0
0
0
0
0
7
0
0
0
0
0
0
0
0
8
11686
3
11646
2
11577
2
11526
4
9
0
0
0
0
0
0
0
0
10
0
0
0
0
0
0
0
0
11
0
0
0
0
0
0
0
0
12
31687
3
31601
3
31749
3
31747
3
13
0
0
0
0
0
0
0
0
14
0
0
0
0
0
0
0
0
15
0
0
0
0
0
0
0
0
16
3474
0
3410
0
3424
0
3491
0
17
0
0
0
0
0
0
0
0
18
0
0
0
0
0
0
0
0
19
0
0
0
0
0
0
0
0
20
24326
0
24503
0
24316
0
24398
0
21
0
0
0
0
0
0
0
0
22
0
0
0
0
0
0
0
0
23
0
0
0
0
0
0
0
0
24
199
0
224
0
216
0
226
0
25
0
0
0
0
0
0
0
0
26
0
0
0
0
0
0
0
0
27
0
0
0
0
0
0
0
0
28
189
0
185
0
203
0
167
0
29
0
0
0
0
0
0
0
0
30
0
0
0
0
0
0
0
0
31
0
0
0
0
0
0
0
0
32
1102
0
1058
0
1031
0
1031
0
33
0
0
0
0
0
0
0
0
34
0
0
0
0
0
0
0
0
35
0
0
0
0
0
0
0
0
36
0
0
0
0
1
0
0
0
37
0
0
0
0
0
0
0
0
38
0
0
0
0
0
0
0
0
39
0
0
0
0
0
0
0
0
40
1
0
0
1
2
0
0
1
41
0
0
0
0
0
0
0
0
42
0
0
0
0
0
0
0
0
43
0
0
0
0
0
0
0
0
44
0
0
2
0
1
0
1
0
45
0
0
0
0
0
0
0
0
46
0
0
0
0
0
0
0
0
47
0
0
0
0
0
0
0
0
48
0
0
1
0
0
0
1
0


Back to top



Team
Please address any comments to the performance team: linux390@de.ibm.com