| 284 | ==== Read Cache, Write Cache, !ReadAhead and Battery ==== |
| 285 | |
| 286 | A quick section about performance tunning.... |
| 287 | |
| 288 | Let's enabled Read Cache, and always cache data: |
| 289 | {{{ |
| 290 | server:~# megacli -LDSetProp -Cached -LAll -aAll |
| 291 | |
| 292 | Set Cache Policy to Cached on Adapter 0, VD 0 (target id: 0) success |
| 293 | Set Cache Policy to Cached on Adapter 1, VD 0 (target id: 0) success |
| 294 | }}} |
| 295 | |
| 296 | Enable disks' cache: |
| 297 | {{{ |
| 298 | mancoosi:~# megacli -LDSetProp EnDskCache -LAll -aAll |
| 299 | |
| 300 | Set Disk Cache Policy to Enabled on Adapter 0, VD 0 (target id: 0) success |
| 301 | Set Disk Cache Policy to Enabled on Adapter 1, VD 0 (target id: 0) success |
| 302 | }}} |
| 303 | |
| 304 | About !ReadAhead: this feature will read more stuff and store in the cache, guessing the system ''may'' access it soon.[[BR]] |
| 305 | We're going to enable an enhanced version of readahead: the adaptative one.[[BR]] |
| 306 | With this option, readahead will only be enabled if the controller receive several access to sequencial sectors. If not, it won't be used to avoid filling cache with randon useless data (in case of randomly accessed sector). |
| 307 | |
| 308 | {{{ |
| 309 | server:~# megacli -LDSetProp ADRA -LALL -aALL |
| 310 | |
| 311 | Set Read Policy to Adaptive ReadAhead on Adapter 0, VD 0 (target id: 0) success |
| 312 | Set Read Policy to Adaptive ReadAhead on Adapter 1, VD 0 (target id: 0) success |
| 313 | }}} |
| 314 | |
| 315 | Now we're going to enable write cache. Beware of data loss! Write cache should be enabled ONLY if you have a battery pack on your controller.[[BR]] |
| 316 | Let's check if we have one and if it's working fine: |
| 317 | {{{ |
| 318 | server:~# megacli -AdpBbuCmd -GetBbuStatus -a0 | grep -e '^isSOHGood' -e '^Charger Status' -e '^Remaining Capacity' |
| 319 | Charger Status: Complete |
| 320 | Remaining Capacity: 1445 mAh |
| 321 | isSOHGood: Yes |
| 322 | |
| 323 | server:~# megacli -AdpBbuCmd -GetBbuStatus -a1 | grep -e '^isSOHGood' -e '^Charger Status' -e '^Remaining Capacity' |
| 324 | Charger Status: Complete |
| 325 | Remaining Capacity: 1353 mAh |
| 326 | isSOHGood: Yes |
| 327 | }}} |
| 328 | |
| 329 | Both adapters have one in this server, let's enable write cache: |
| 330 | {{{ |
| 331 | server:~# megacli -LDSetProp WB -LALL -aALL |
| 332 | |
| 333 | Set Write Policy to WriteBack on Adapter 0, VD 0 (target id: 0) success |
| 334 | Set Write Policy to WriteBack on Adapter 1, VD 0 (target id: 0) success |
| 335 | }}} |
| 336 | |
| 337 | But disable it if the battery went broken or discharged: |
| 338 | {{{ |
| 339 | server:~# megacli -LDSetProp NoCachedBadBBU -LALL -aALL |
| 340 | |
| 341 | Set No Write Cache if bad BBU on Adapter 0, VD 0 (target id: 0) success |
| 342 | Set No Write Cache if bad BBU on Adapter 1, VD 0 (target id: 0) success |
| 343 | }}} |
| 344 | |
| 345 | Now we can check if everythin and fine and reboot the server (not sure if it's needed): |
| 346 | {{{ |
| 347 | server:~# megacli -LDInfo -LAll -aAll |
| 348 | |
| 349 | Adapter 0 -- Virtual Drive Information: |
| 350 | Virtual Disk: 0 (Target Id: 0) |
| 351 | [...] |
| 352 | Default Cache Policy: WriteBack, ReadAdaptive, Cached, No Write Cache if Bad BBU |
| 353 | Current Cache Policy: WriteBack, ReadAdaptive, Cached, No Write Cache if Bad BBU |
| 354 | Access Policy: Read/Write |
| 355 | Disk Cache Policy: Enabled |
| 356 | Encryption Type: None |
| 357 | |
| 358 | Adapter 1 -- Virtual Drive Information: |
| 359 | Virtual Disk: 0 (Target Id: 0) |
| 360 | [...] |
| 361 | Default Cache Policy: WriteBack, ReadAdaptive, Cached, No Write Cache if Bad BBU |
| 362 | Current Cache Policy: WriteBack, ReadAdaptive, Cached, No Write Cache if Bad BBU |
| 363 | Access Policy: Read/Write |
| 364 | Disk Cache Policy: Enabled |
| 365 | Encryption Type: None |
| 366 | }}} |
| 367 | |