Skip to content

What is the maximum number of commands queued to a LUN

July 1, 2008

This is not quite a one liner as I’m reusing the code from a previous post to print out the devices in a human readable form other wise it is just a one liner and was when I typed it in.

The question posed here was what is the maximum number of commands sent to a LUN at any one time? Clearly this will max out at the throttle for the device however what was interesting, since the customer had already tuned the throttle down and the problem had gone away was what was their configuration capable of sending to the LUN:

#!/usr/sbin/dtrace -qCs
#define SD_TO_DEVINFO(un) ((struct dev_info *)((un)->un_sd->sd_dev))
#define DEV_NAME(un) \
 stringof(`devnamesp[SD_TO_DEVINFO(un)->devi_major].dn_name) /* ` */
#define DEV_INST(un) (SD_TO_DEVINFO(un)->devi_instance)
fbt:*sd:*sd_start_cmds:entry  {
        @[DEV_NAME((struct sd_lun *)arg0),DEV_INST((struct sd_lun *)arg0)] = max((struct sd_lun *)arg0->un_ncmds_in_driver)
      printa("%s%d %@d\n", @);

This produces a nice list of disk devices and the maximum number of commands that have been sent to them at anyone time:

# dtrace -qCs  /var/tmp/max_sd.d -n 'tick-5sec { exit(0) }'
sd2 1 sd0 70

Combine that with the dscript from the latency bubble posting earlier and you can drill down on where your IO is waiting.


From → bsc, Solaris

  1. Hi Chris,
    I got the following:
    dtrace: failed to compile script ./d: line 12: args[ ] may not be referenced because probe description fbt:*sd:*sd_start_cmds:entry matches an unstable set of probes
    Where is the problem ? This is Solaris 10 8/07.

  2. I don’t know why you see that, although I do too on 10 when both sd and ssd are loaded.
    If you do s/args[0]/(struct sd_lun *)arg0/ that should get it to work.
    fbt:*sd:*sd_start_cmds:entry { @[DEV_NAME((struct sd_lun *)arg0),DEV_INST((struct sd_lun *)arg0)] = max(((struct sd_lun *)arg0)->un_ncmds_in_driver) }

  3. That works. Thanks Chris ! 🙂

Trackbacks & Pingbacks

  1. Using Dtrace to monitor max throttle on Solaris | unixtipsandtricks

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: