Announcement Banner

SYDNEY2

updated

19 years ago

S

SYDNEY2

16 Posts

0

3037

May 28th, 2007 17:00

Read and Write Cache

Hello, we have a CLARiiON CX500 with 4GB of memory. This SAN is entirely dedicated to our Oracle RAC database. Attached to this SAN via fibre channel are two Dell PowerEdge 1850 Blade servers running RHEL 4. These servers are hosting an Oracle 10g Release2 RAC database (Standard Edition). Database files are on ASM and the CRS files (registry and voting disk) are on OCFS2. My question is about the read and write cache. I'm looking for advice on sizing the write and read caches for (a) an OLTP db or (b) an OLAP db. Someone told me I should disable the read cache and maximize the write cache, is this true? Thanks in advance for sharing your experiences.
  • 1495

    0

    Posted May 29th, 2007 01:00

    I dont think that its correct choice to disable read cache. Since your env is OLTP (i.e. Write intensive you might want to keep the ratio 75 Write 25 Read. Try doing it this way, analyse the Cache hit/miss ratios and keep on tuning the cache until you get the best application performance.
    You might also need to configure RAID 1/0 groups for the OLTP. Raid 5 is best for sequential reads and 1/0 for OLTP.

    Hope this helps
    Navin.
  • Kiran3

    410 Posts

    1495

    1

    Posted May 29th, 2007 02:00

    thats correct...
    there should always be some amount of read cache present on the array.

    you can selectively disable read/write cache on the luns which you do not wish to be cached for reads or writes respectively. i would suggest you consider disabling cache prefetch and let just read cache be on for the luns. this along with small amount of global read cache will give better performance then disabling read cache altogether.
  • AranH1

    2163 Posts

    1495

    1

    Posted May 29th, 2007 07:00

    I agree with Navin and Kiran, keep the read cache enabled. At the most you might want to max out the write cache and use a minimal amount for read cache.

    Another setting to consider is the low and high watermark thresholds. The default setting of 60% and 80% is fine for the majority of applications but if you find that your particular application is very write intensive and heavy in the number of write i/o being sent to the array then you may experience a performance degradation if the high watermark is reached too frequently and the array is spending time dumping the cache to disk.

    I have found in some instances with OLTP databases that setting the low and high watermark to 40% and 60% respectively improved the performance of the database servers on our arrays.
  • SYDNEY2

    16 Posts

    1495

    0

    Posted May 29th, 2007 08:00

    Hi,

    Thanks everyone. Lots of good advice here. Via Navisphere Manager, I have sized the read cache and enabled it, as you can see from the output below.

    Does any one know why "Read Hit Ratio" and "Write Hit Ratio" are showing up as "N/A"??

    [root@rac1 bin]# ./navicli -h 192.168.1.10 getcache
    SP Read Cache State Enabled
    SP Write Cache State Enabled
    Cache Page size: 8
    Write Cache Mirrored: YES
    Low Watermark: 60
    High Watermark: 80
    SPA Cache pages: 117067
    SPB Cache pages: 20660
    Unassigned Cache Pages: 0
    Read Hit Ratio: N/A
    Write Hit Ratio: N/A

    Prct Dirty Cache Pages = 57
    Prct Cache Pages Owned = 84
    SPA Read Cache State Enabled
    SPB Read Cache State Enabled
    SPA Write Cache State Enabled
    SPB Write Cache State Enabled
    System Buffer (spA): 576 MB
    System Buffer (spB): 576 MB
    SPS Test Day: Sunday
    SPS Test Time: 06:00
    SPA Physical Memory Size = 2048
    SPB Physical Memory Size = 2048
    Physical memory size of Front-End = Switch not supported
    Physical memory size of Back-End = Switch not supported
    SPA Free Memory Size = 66
    SPB Free Memory Size = 66
    Free Memory Size of Front-End = Switch not supported
    Free Memory Size of Back-End = Switch not supported
    SPA Read Cache Size = 300
    SPB Read Cache Size = 300
    SPA Write Cache Size = 1106
    SPB Write Cache Size = 1106
    SPA Optimized Raid 3 Memory Size = 0
    SPB Optimized Raid 3 Memory Size = 0

    [root@rac1 bin]#


    Thanks.
  • AranH1

    2163 Posts

    1495

    0

    Posted May 29th, 2007 09:00

    I believe that the read and write cache hit ratios are specific to each LUN and don't know if the properties of the array or a getcache from navicli are supposed to show an average of hit rations across all LUNs in the array.

    The listing of that property doesn't make sense to me at an array level because it will be very different for each LUN depending on the application behavior reading and writing to each LUN.

    You can view the cache hit ratios in Navisphere analyzer by enabling the advanced view of Analyzer performance metrics by going to Tools > Analyzer > Customize and checking the Advanced option on the General tab.
  • SYDNEY2

    16 Posts

    1495

    0

    Posted May 29th, 2007 11:00

    I believe that the read and write cache hit ratios
    are specific to each LUN


    Okay, specific to each lun, so I found the navicli command to query the lun:

    ---------------------------------------------------------
    [root@rac1 bin]# ./navicli -h 192.168.1.10 getlun 0 -rh -wh
    Read Hit Ratio: N/A
    Write Hit Ratio: N/A

    [root@rac1 bin]# ./navicli -h 192.168.1.10 getlun 1 -rh -wh
    Read Hit Ratio: N/A
    Write Hit Ratio: N/A

    [root@rac1 bin]# ./navicli -h 192.168.1.10 getlun 2 -rh -wh
    Read Hit Ratio: N/A
    Write Hit Ratio: N/A

    [root@rac1 bin]#
    ---------------------------------------------------------

    Still no luck. Could it be because we don't have Analyzer installed on the CX500?
  • AranH1

    2163 Posts

    1495

    0

    Posted May 29th, 2007 14:00

    As long as you have statistics logging enabled on your array you should be able to view most of the performance metrics through the cli. There are some performance metrics that you cannot view through the cli though, and the cache hit ratio may be one of them. Those you have to use Navisphere Analyzer for, but if you don't have Analyzer installed in your system I don't think you will be able to view those metrics.

    That being said, is there a reason you want to view those performance counters in particular?
  • Kiran3

    410 Posts

    1495

    0

    Posted May 30th, 2007 00:00

    ya, statistics loggin needs to be enabled.
    i am not sure if this causes any noticeable performance hit but once you find your optimal parameters, you can turn it off.

    That being said, is there a reason you want to view those performance counters in particular?

    maybe to check cache benefit on a individual lun..
  • AranH1

    2163 Posts

    1495

    0

    Posted May 30th, 2007 07:00

    Enabling the Advanced option does not log any more information, all the counters are there when Statistics Logging is enabled. The Advanced option in Analyzer enables you to view those advanced parameters when viewing live data or archive data through Analyzer.
  • SYDNEY2

    16 Posts

    95

    0

    Posted May 30th, 2007 08:00

    Hi,

    I checked. Yes, "Statistics Logging" is enabled on my cx500. I'm guessing these cache hit ratios are metrics that can't be viewed unless Analyzer is installed. I was curious to see these metrics to fine-tune my cache sizes.

    Thanks everyone, for sharing your expertise.