Tags
I was given the task of checking the array accelerator cache ratio and see if it was set to optimal levels. Our ideal preference was a read/write ratio of 0/100.
The machine configuration is HP DL180 G5, 2 x Xeon L5420 2.50GHz, 15.7GB / 16GB 667MHz DDR2, 6 x 300GB-15K SAS.This machine was running mysql 5.1.36 using the innodb plugin.
The command line utility to check the controller configuration is “hpacucli”. Navigating using hpacucli is very straight forward.
“ctrl all show config detail” Will give you the entire controller configuration.
=> ctrl all show config detail
Smart Array P400 in Slot 5
Bus Interface: PCI
Slot: 5
Serial Number: P61630K9SW31NL
Cache Serial Number: PA82C0J9SW02H1
RAID 6 (ADG) Status: Enabled
Controller Status: OK
Chassis Slot:
Hardware Revision: Rev D
Firmware Version: 4.12
Rebuild Priority: Medium
Expand Priority: Medium
Surface Scan Delay: 15 secs
Post Prompt Timeout: 0 secs
Cache Board Present: True
Cache Status: OK
Accelerator Ratio: 0% Read / 100% Write
Drive Write Cache: Disabled
Total Cache Size: 256 MB
Battery Pack Count: 1
Battery Status: OK
SATA NCQ Supported: TrueArray: A
Interface Type: SAS
Unused Space: 0 MB
Status: OKLogical Drive: 1
Size: 1.4 TB
Fault Tolerance: RAID 5
Heads: 255
Sectors Per Track: 32
Cylinders: 65535
Stripe Size: 64 KB
Status: OK
Array Accelerator: Enabled
Parity Initialization Status: Initialization Completed
Unique Identifier: 600508B100104B39535733314E4C0003
Disk Name: /dev/cciss/c0d0
Mount Points: / 3.9 GB, none 12.0 GB, /var 3.9 GB, /tmp 3.9 GB, /home 1.3 TB
Logical Drive Label: A0432BCEP61630K9SW31NLD55Fphysicaldrive 1I:1:1
Port: 1I
Box: 1
Bay: 1
Status: OK
Drive Type: Data Drive
Interface Type: SAS
Size: 300 GB
Rotational Speed: 15000
Firmware Revision: 0005
Serial Number: 3QP1BEP400009004UQCD
Model: SEAGATE ST3300656SS
PHY Count: 2
PHY Transfer Rate: 3.0GBPS, Unknown
physicaldrive 1I:1:2
Port: 1I
Box: 1
Bay: 2
Status: OK
Drive Type: Data Drive
Interface Type: SAS
Size: 300 GB
Rotational Speed: 15000
Firmware Revision: 0005
Serial Number: 3QP1ZZRN000090035Q2Q
Model: SEAGATE ST3300656SS
PHY Count: 2
PHY Transfer Rate: 3.0GBPS, Unknown
physicaldrive 1I:1:3
Port: 1I
Box: 1
Bay: 3
Status: OK
Drive Type: Data Drive
Interface Type: SAS
Size: 300 GB
Rotational Speed: 15000
Firmware Revision: 0005
Serial Number: 3QP20VCQ00009004XE2V
Model: SEAGATE ST3300656SS
PHY Count: 2
PHY Transfer Rate: 3.0GBPS, Unknown
physicaldrive 1I:1:4
Port: 1I
Box: 1
Bay: 4
Status: OK
Drive Type: Data Drive
Interface Type: SAS
Size: 300 GB
Rotational Speed: 15000
Firmware Revision: 0005
Serial Number: 3QP1ZZSB00009003MMWZ
Model: SEAGATE ST3300656SS
PHY Count: 2
PHY Transfer Rate: 3.0GBPS, Unknown
physicaldrive 1I:1:5
Port: 1I
Box: 1
Bay: 5
Status: OK
Drive Type: Data Drive
Interface Type: SAS
Size: 300 GB
Rotational Speed: 15000
Firmware Revision: 0005
Serial Number: 3QP1L4T000009004UQCV
Model: SEAGATE ST3300656SS
PHY Count: 2
PHY Transfer Rate: 3.0GBPS, Unknown
physicaldrive 1I:1:6
Port: 1I
Box: 1
Bay: 6
Status: OK
Drive Type: Data Drive
Interface Type: SAS
Size: 300 GB
Rotational Speed: 15000
Firmware Revision: 0005
Serial Number: 3QP196KG00009004S0ZH
Model: SEAGATE ST3300656SS
PHY Count: 2
PHY Transfer Rate: 3.0GBPS, Unknown
In the above output our point of interest was “Accelerator Ratio: 0% Read / 100% Write“. In this case it has been set to an optimal value. In case it wasn’t set to an optimal value it can be changed using the command “ctrl slot=5 modify cacheratio=0/100“
When you are stuck for a particular command, you can just run “help <command name>” for more input.
=> help aa
The following documentation pertains to your search:
<target> modify [arrayaccelerator=enable|disable]
Enables or disables the array accelerator for a given logical drive. The
target can be any valid logical drive target on a controller that supports
array accelerator management.<target> modify [cacheratio=#/#|?]
Sets the array accelerator cache ratio for the controller. The first # is
the read cache %. The second # is the write cache %. The target can be any
valid controller.<target> create [type=ld]
[drives=[#:]#:#,[#:]#:#,[#:]#:#-[#:]#:#],…|all|allunassigned]
[raid=6|5|1+0|1|0|?]
[size=#|?]
[stripesize=8|16|32|64|128|256|default|?]
[sectors=32|63|?]
[arrayaccelerator=enable|disable|?]
[drivetype=sas|satalogical|sata|saslogical|parallelscsi|?][type=] The type parameter specifies the device type that is being created.
A logical drive is the only device type supported at this time.[drives=] The drives parameter specifies the physical drives to be used for
creating a logical drive on a new or existing array. If the drives specified
are all unassigned drives, then a new array will be created with a new
logical drive on it. If the drives specified are all assigned to an existing
array, then a new logical drive will be created on that array. The symbol
#:# stands for port:id or box:bay, depending on the controller. Some
controllers may also support port:box:bay and use the #:#:# syntax. The all
and allunassigned keywords both target all physical drives that are not
currently assigned to an array.[raid=] The raid parameter sets the raid level of the logical drive. If not
specified, the default raid is the highest level possible. The availability
of certain raid settings depends on the number of drives designated in the
“drives=” parameter. For example, RAID 1 will only be available if two
drives are selected while RAID 1+0 will be shown for a selection of 4 or
more drives.[size=] The size parameter specifies the size of the logical drive, the
implied units are MB. If not specified, the default is the maximum possible
size.[stripesize=] The stripesize parameter sets the logical drive’s stripesize.
The implied units of stripe size are KB.[sectors=] The sectors parameter specifies the sectors per track of the
logical drive. If not specified, the default is 32.[arrayaccelerator=] The arrayaccelerator parameter specifies the array
accelerator state for the logical drive. If not specified, the default is
enable.[drivetype=] The drivetype parameter specifies the drive
interface type. If there are multiple drive types when selecting all
physical drives, the desired drive type needs to be specified. Mixed drives
are not allowed on the same array or logical drive. If all drive types in a
controller are the same this parameter is not needed. The target can be a
controller or an array in the system.Examples:
controller slot=3 logicaldrive 2 modify arrayaccelerator=enable
controller slot=1 modify cacheratio=25/75
ctrl slot=1 create type=ld drives=1:1,1:2,1:3,1:5 raid=6
ctrl slot=1 create type=ld drives=1:1-1:6,1:9,1:10-1:12 raid=6
ctrl slot=1 create type=ld drives=all drivetype=parallelscsi
controller slot=5 array A create type=ld raid=5 size=1000
controller slot=1 array C create type=ld raid=1 stripesize=32
ctrl slot=1 create type=ld drives=1:1,1:2,1:3,1:5 raid=?
ctrl slot=1 create type=ld drives=1:1,1:2,1:3,1:5 stripesize=?
ctrl slot=1 create type=ld drives=1:1,1:2,1:3,1:5 raid=1+0 stripesize=?
ctrl slot=1 create type=ld drives=1:1,1:2 raid=1 size=?
ctrl slot=1 create type=ld drives=1:1,1:2,1:3,1:5 raid=1+0 sectors=?
With various firmwares you can see different results, e.g. random stalls with high write caches. Also, do note that even if for random i/o no read-ahead cache is good enough, if you want to do any batch copying of your data, you may want to enable read cache. YMMV.
Hi Alex,
I just checked in a Perl module I wrote a few months ago to parse the output of HP’s hpacucli so you can use it programmatically:
http://code.google.com/p/perl-raid-tools/source/browse/#svn/trunk/Parse-HP-ACU
Additionally, I wrote a tool called system-summary which does a decent job of summarizing the hardware for you, including the RAID controller and its current status:
http://code.google.com/p/system-summary/
Would love any feedback you might have, and of course patches/fixes!
Hi Jeremy, sure will check it out and let you know. I don’t know whether you remember me or not, i got started into mysql through you training in 2005 @ Yahoo Bangalore office during the month of April ! Thanks for dropping by.
Yes that very true about various firmwares provide different behavior. Also the settings and terms differ from controller to controller. Generally we depend on the raid controller cache for caching only the writes, since reads are better cached in database buffer caches.
Alex,
Of course I remember you from Yahoo Bangalore!
Re. read-ahead, what Domas is saying is that disabling read-ahead caching completely will cause sequential scans to perform much worse than necessary. This is because the RAID controller will only read exactly what is necessary to satisfy each request — normally the RAID controller would try to predictively read a bit or a lot ahead of the current request in order to pre-satisfy future requests. With sequential scanning queries, this gives a huge performance boost, independent of the buffer pool behaviour.
Regards,
Jeremy
Jeremy/Domas, thanks for the clarifications. So what would be an ideal read/write ratio for the accelerator cache? In some of our dell controllers i have seen by default the controller readahead has been disabled.
Hi Alex,
Probably there isn’t an “ideal” ratio, but it would depend on the workload. If you know that you will only ever have key reads and never scans, 0/100 would be fine. If you might sometimes have scans, and you don’t think you’ll need all write cache space, probably best to go with 25/75 or so.
Regards,
Jeremy
Thanks Jeremy !
=> ctrl slot=1 modify cacheratio=50/50
Error: “cacheratio=50/50″ is not a valid option for Smart Array P400 in Slot 1
There are no options currently available.
Any idee?
I know this is an old threat, but I’ve found it via goodle, probably someone will as well, so maybe it wil be usefull for them:
You need to have battery pack to enable Array Acceleration for writes. If you don’t have one, you can override it by using:
ctrl slot=x modify nbwc=enable
And then ctrl slot=x modify cacheratio=xx/xx command will be available for use!
It is not safe; as if you lose power you will lose your data! But if you have a system UPS than it should be OK I think