DaveWentzel.com            All Things Data

HBAs

 

What is an HBA?
Host Bus Adapter.  It is a type of SCSI initiator that is placed in the host and communicates with the SAN. 
 
Said another way...it is the hardware component that provides the interface between the storage network and the server backplane. 
 
Even though it is considered a "SCSI initiator" most HBA are really Fibre Channel. 
 
Q Depth
Most HBA's have a QueueDepth setting.  The setting throttles the maximum amount of IO operations that can simultaneously flow from the HBA port to the SAN.  A queue depth setting of 1 means that the controller will not take any additional IO requests until the first request has been satisfied.  A setting of 32 indicates that after 32 outstanding IO requests the HBA will not take any additional.  The controller can actually reorder requests with the goal of potentially increasing the total IOPS but at the expense of sacrificing latency for any single IO request.  
 
This translates into latency for the application.  A simple rule of thumb is that each doubling of Q depth will be equivalent to a doubling of latency, but of course your IOPs is improving too.  
 
Changing this can increase performance (depending) but you need to test.  There are no hard and fast rules.  There are only so many IOPS a disk subsytem can handle so you don't want to set this too high otherwise other hosts on the SAN will suffer performance problems.  If you have few hosts then up'ing the QD may be helpful.   The default QD setting for most HBA drivers is 32.  This is often too low for SQL Server which can concurrently issue a large number of outstanding I/O requests (such as for checkpointing and read-ahead operations).  128 or 255 is sometimes recommended for optimal performance. 
 
For OLTP you want latency to be lower, potentially at the cost of throughput.  For batch-oriented databases, latency is not as big of a concern, since response time is not the primary goal, so we sacrifice some latency for better throughput overall.  
 
The latency is measured using the PerfMon counter Avg Sec/Disk Transfer (or equivalent).  If I see numbers around 10ms then I know performance should be good.  Numbers higher than that should be suspect.  Due to RAID and other storage abstractions you can't target a Q depth number directly by looking at PerfMon.  It's not unusual for there to be latency numbers well, well above 10ms during temporary activity spikes.  If you think about it, this symptom is indicative of a very high Q depth setting which is causing those latencies to jump radically.  
 
One way to cut down on the latency, if performance is your goal, is to reduce average seek times and increase transfer rates and throughput.  How do you do that?  Use short stroking.  
 
Be careful though.  Some HBAs cite Q depth settings at the adapter level, others at the target level.  The target level settings are new.  Formerly, Q depth settings were adapter-wide only.  With settings at the target level we can get much more fine-grained, focusing Q depths differently depending on whether it is sequential log writes vs more random data reads.  
 
The more disks that make up your LUN, the higher you should be able to drive the Q depth settings.  
 
Other settings you should be aware of: 
  • BIOS
  • Spin up delay (the BIOS waits (sometimes up to 2 minutes) for the first drive to spin up)
  • enable selectable boot (you choose a WWPN/LUN to use for boot purposes)
 
Always consider using multiple HBAs if available.  If you do make sure they are on different buses to prevent bus saturation.  PCI slots have different bus speeds so make sure you plug your HBAs into the fastest slot. 
 
HBAs have a WWN
 

Add new comment