Informing the IBM Community

AIX tech tip: a tribute to AIX devices

0
(0)

monitoringWhen you have a device connected to AIX, such as a disk or a tape drive, you can discover it using cfgmgr. As you’d expect, it will have the default parameters that are used for the device driver.

Sometimes you’ll want to change these parameters – usually to allow you to tune the device for performance. To list the attributes available for a device, use the lsattr command.

The most common flags here are:

-l to point to the logical device

and

-E for the effective values in use.

It is helpful to display the header for each field, too. You can do that using the –H flag. Here’s a list of the attributes for a virtual SCSI disk using “lsattr –EHl hdisk2”:

attribute       value            description                user_settable
 
PCM             PCM/friend/vscsi Path Control Module        False
algorithm       fail_over        Algorithm                  True
hcheck_cmd      test_unit_rdy    Health Check Command       True
hcheck_interval 0                Health Check Interval      True
hcheck_mode     nonactive        Health Check Mode          True
max_transfer    0x40000          Maximum TRANSFER Size      True
pvid            00c49d54db682c060000000000000000 Physical volume identifier False
queue_depth     24               Queue DEPTH                True
reserve_policy  no_reserve       Reserve Policy             True

To display just the one attribute, you can specify it with the –a flag. Here’s how to see the queue depth (number of concurrent I/Os allowed on a disk).

lsattr -EHlhdisk2 -a queue_depth

attribute         value description user_settable 
queue_depth 24    Queue DEPTH       True

If you can see that this attribute is “user settable” (it can be changed by you), then it’s sometimes helpful to know the available values. You can do that by replacing the –E in the lsattr command with a –R. You’ll need to specify which attribute you want to change. Once again, use the –a flag.

Here are the possible values I can change the queue depth to:

lsattr  -Rl hdisk2 –a queue_depth

1...256 (+1)

… which means I could go up to a queue depth of 256. Incidentally, you’d need to change that on the Virtual I/O Server as well, or else the client will be allowed to pump a large number of I/Os through and then the VIOS will be the bottleneck, due to a small queue depth on its disk.

For more information about changing the queue depth, and how this can help with disk performance, see the IBM Techdoc referred to in the resources section at the bottom of this article.

Changing attributes

Changing a device’s attribute is usually done with the chdev command.

chdev –l device –a attribute=value

So, here’s how to enable dynamic tracking on a fibre channel adapter.

chdev –l fcs0 –a dyntrk=yes

And if you’re wondering about dynamic tracking and why you’d ever want to change it, see that same Techdoc I just mentioned.

Sometimes you’ll try to change a device and get an error reporting that the device is busy. It will depend on the device but if it’s something that is constantly in use (such as a disk in rootvg), you’ll either have to free it up from use by any processes, or else set a flag on the chdev command which makes the change permanent. The flag is –P

chdev –l fcs0 –a dyntrk=yes -P

I like to think of the –P flag as the “postpone-till-reboot” flag. Once you make the change on the device, it will take effect from the next reboot.

Of course, there are special commands which deal specifically with disks – commands that are covered by the AIX Logical Volume Manager – but for most other devices, I tend to get by with lsattr to list their attributes and chdev to change them.

Resources

IBM Techdocs Library: Setting the queue depth for performance tuning

IBM Knowledge Center: List device attributes with the lsattr command

IBM Knowledge Center: Change device characteristics using chdev

Having worked on IBM systems since 1991, Anthony English has seen how AIX and virtualisation can manage all kinds of business environments. He is a well-recognised author in the IT field and he writes about business systems improvement through his blog https://anthonyenglish.com.au. Anthony is based in Sydney, Australia, with his wife and his seven children.

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.