Archive

Posts Tagged ‘LNS’

LNS and LOG_BUFFER

March 2, 2017 1 comment

In a oracle data guard environment Log Network Server (LNS) process transports the redo from the primary to the standby site. The behavior of LNS process is different from SYNC and ASYNC mode replication. In ASYNC mode transport, LNS read the redo from log buffer and hand over it to the RFS process in the target site. It is not necessary the redo is always available in the buffer cache. If there is not enough buffer to hold the rate of redo generation, LNS transport lags behind, then read from the Online Redo File causing physical I/O, reducing overall redo transport performance. So, it is important to ensure that, database is configured with enough log buffers so that redo will be available in the log buffer. In certain cases, we may need to analyze network performance and make sure the band width supporting the redo generation rate.
Oracle externalized buffer hit ratios through the view x$logbuf_readhist and the important columns are –
BUFSIZE – Actual and estimated buffer sizes. CURRENT row is the configured log buffer row
RDMEMBLKS – Actual and estimated reads from the log buffer
RDDISKBLKS – Actual and estimated reads from the Online Redo Log files
HITRATE – Memory hit ratio for the corresponding buffer size. CURRENT (BUFINFO) is the line for present log buffer. Ratio is calculated by RDMEMBLKS/( RDMEMBLKS+ RDDISKBLKS). It is important that we keep the hit ratios close to 100% in a healthy performing data guard environment.

SQL> select INST_ID,BUFSIZE,RDMEMBLKS,RDDISKBLKS,HITRATE,BUFINFO from x$logbuf_readhist
     INST_ID BUFSIZE              RDMEMBLKS                RDDISKBLKS                  HITRATE BUFINFO
---------- -------------------- ------------------------ ------------------------ ---------- --------------------
         2 40960K               227100628                422257113                        34
         2 49152K               260607089                388750652                        40
         2 57344K               295806637                353551104                        45
         2 65536K               347028496                302329245                        53
         2 73728K               544307366                105050375                        83
         2 81920K               548003937                101353804                        84 CURRENT
         2 90112K               557950886                91406855                         85
         2 98304K               563062694                86295047                         86
         2 106496K              567363494                81994247                         87
         2 114688K              570779558                78578183                         87
         2 122880K              573573030                75784711                         88
         2 131072K              576063398                73294343                         88
         2 139264K              577963942                71393799                         89
         2 147456K              579520422                69837319                         89
         2 155648K              580839334                68518407                         89
         2 163840K              582027174                67330567                         89 TARGET-90
16 rows selected.

SQL> show parameter log_buff
NAME                                 TYPE                             VALUE
------------------------------------ -------------------------------- ------------------------------
log_buffer                           integer                          83886080

SQL> select 83886080/1024 from dual;
83886080/1024
-------------
        81920

In the above case LOG_BUFFER is configured to 81920K and the corresponding hit ratio is 84% showing possible LNS degrade in redo transport. In this case, upgrading LOG_BUFFER to a higher value or make sure there is no network bottleneck between primary and standby.  This may improve over all dataguard syncing performance.

Advertisements