Previous  |  Next  >  
Product: Volume Replicator Guides   
Manual: Volume Replicator 4.1 Planning and Tuning Guide   

Tuning VVR

This section describes how to adjust the tunable parameters that control the system resources used by VVR. Depending on the system resources that are available, adjustments may be required to the values of some tunable parameters to optimize performance.

For instructions on changing the value of tunables, refer to the VERITAS Volume Replicator Administrator's Guide.

VVR Buffer Space

VVR uses the following buffers to replicate data:

Write Buffer Space on the Primary

When a write is issued, a write buffer is allocated from the write buffer space on the Primary. The buffer is not released until the data has been written to the Primary SRL and sent to all the Secondaries in synchronous mode. If the Secondaries in asynchronous mode cannot keep up with the application write rate, the data to be sent to the Secondary starts accumulating in the write-buffer space on the Primary. As a result, write-buffer space on the Primary becomes low. Then, VVR begins to free some buffers and postpones sending the data to the Secondaries in asynchronous mode. As a result, more space is freed up for incoming write requests so that they are not delayed.

Readback Buffer Space on the Primary

When VVR is ready to send the freed request to the Secondary, the freed requests are read back from the SRL. The data from the SRL is read back in to the Readback buffer space on the Primary.

As discussed in Choosing the Mode of Replication, the need to read back data from the SRL has an impact on write latency because more non-sequential I/O is performed on the SRL. Reading back data from the SRL also increases the load on the system and slows the rate at which data is sent to the Secondaries.

Note that the write buffer is freed only if the mode of replication is asynchronous; the writes do not have to be read back from the SRL when replicating in synchronous mode.

Buffer Space on the Secondary

The writes from the Primary are received in to the buffer space on the Secondary. The write is then written to the Secondary data volume from this buffer space. A write on the Primary can complete before the write to the Secondary data volume completes, even in synchronous mode of replication. However, if the Secondary is low on buffer space, it rejects new writes from the Primary thereby slowing down the Primary. On the Primary this appears as an inability to send requests over the network. The results are identical to those pertaining to insufficient network bandwidth.

For Secondaries in asynchronous mode, there may be no limit to how far Secondary data volumes can fall behind unless the mechanisms discussed in Choosing Latency and SRL Protection are in force. Hence, if all the Secondaries are replicating in asynchronous mode, the application may not slow down; if there are Secondaries in synchronous mode, the write rate of the application reduces.

Tunable Parameters for the VVR Buffer Spaces

The amount of buffer space available to VVR affects the application and replication performance. You can use the following tunables to manage buffer space according to your requirements:

  • vol_rvio_maxpool_sz
  • vol_min_lowmem_sz
  • vol_max_rdback_sz 
  • vol_max_nmpool_sz

Use the vxmemstat command to monitor the buffer space used by VVR. The following sections describe each of the above tunables. For instructions on changing the value of the tunable parameters, refer to the VERITAS Volume Replicator Administrator's Guide.


Tunable Parameters for the Write Buffer Space on the Primary

The following tunable parameters control the write buffer space on the Primary:

  • vol_rvio_maxpool_sz
  • vol_min_lowmem_sz

The amount of buffer space that can be allocated within the operating system to handle incoming writes is defined by the tunable vol_rvio_maxpool_sz.

How VVR Uses Buffers Between the Primary and Secondary

How VVR Uses Buffers Between the Primary and Secondary

Click the thumbnail above to view full-sized image.

If the available buffer space is not sufficient to process the write request, writes are held up. VVR must wait for current writes to complete and release the memory being used before processing new writes. Furthermore, when the buffer space is low, VVR frees buffers early, requiring VVR to read back the write from the SRL, as explained in Write Buffer Space on the Primary. Both these problems can be alleviated by increasing vol_rvio_maxpool_sz. By setting the vol_rvio_maxpool_sz to be large enough to hold the incoming writes, you can increase the number of concurrent writes and reduce the number of readbacks from the SRL. When decreasing the value of the vol_rvio_maxpool_sz tunable, stop all the RVGs on the system on which you are performing this operation.

When deciding whether or not a given write is freed early and read back later, VVR looks at the amount of buffer space available, and frees the write if the amount is below a threshold, which is about 520 kilobytes, twice the size of a maximum write. This threshold is too low in some cases, which results in buffers being held for a long time. New writes cannot be performed because of lack of buffer space.

You can raise the threshold by increasing the value of the tunable vol_min_lowmem_sz. It should be set to, at least, 3 x N x I, but not less than 520K, where N is the number of concurrent writes to replicated volumes, and I is the average I/O size, rounded up to 8 kilobytes. The vol_min_lowmem_sz tunable is auto-tunable and depending on the incoming writes, VVR will increase or decrease the tunable value. The value that you specify for the tunable, using the vxtune utility or the system-specific interface, will be used as an initial value and could change depending on the application write behavior.

Note that this tunable is used only when replicating in asynchronous mode because SRL is not read back when replicating in synchronous mode.

Use the vxrvg stats command to determine the maximum concurrency (N) and average write size (I).


Tunable Parameter for the Readback Buffer Space

The amount of buffer space available for these readbacks is defined by the tunable, vol_max_rdback_sz. To accommodate reading back more data, increase the value of vol_max_rdback_sz. You may need to increase this value if you have multiple Secondaries in asynchronous mode for one or more RVGs.

Click the thumbnail above to view full-sized image.

Use the vxmemstat command to monitor the buffer space. If the output indicates that the amount of space available is completely used, increase the value of the vol_max_rdback_sz tunable to improve readback performance. When decreasing the value of the vol_max_rdback_sz tunable, pause replication to all the Secondaries to which VVR is currently replicating.


Tunable Parameters for the Buffer Space on the Secondary

The amount of buffer space available for requests coming in to the Secondary over the network is determined by the VVR tunable, vol_max_nmpool_sz. VVR allocates separate buffer space for each Secondary RVG, the size of which is equal to the value of the tunable vol_max_nmpool_sz. The buffer space on the Secondary must be large enough to prevent slowing the network transfers excessively.

If the buffer is too large, it can cause problems. When a write arrives at the Secondary, the Secondary sends an acknowledgement to the Primary so that the Primary knows the transfer is complete. When the write is written to the data volume on the Secondary, the Secondary sends another acknowledgement, which tells the Primary that the write can be discarded from the SRL. However, if this second acknowledgement is not sent within one minute, the Primary disconnects the RLINK. The RLINK reconnects immediately but this causes disruption of the network flow and potentially other problems. Thus, the buffer space on the Secondary should be sized in such a way that no write can remain in it for one minute. This size depends on the rate at which the data can be written to the disks, which is dependent on the disks themselves, the I/O buses, the load on the system, and the nature of the writes (random or sequential, small or large).

If the write rate is W megabytes/second, the size of the buffer should be no greater than W * 50 megabytes, that is, 50 seconds' worth of writes.

There are various ways to measure W. If the disks and volume layouts on the Secondary are comparable to those on the Primary and you have I/O statistics from the Primary before replication was implemented, these statistics can serve to arrive at the maximum write rate.

Alternatively, if replication has already been implemented, start by sizing the buffer space on the Secondary to be large enough to avoid timeout and memory errors.

While replication is active at the peak rate, run the following command and make sure there are no memory errors and the number of timeout errors is small:


vxrlink -g diskgroup -i5 stats rlink_name

Then, run the vxstat command to get the lowest write rate:


vxstat -g diskgroup -i5

The output looks similar to this:


                     OPERATIONS           BLOCKS      AVG TIME(ms)
TYP NAME          READ     WRITE      READ     WRITE   READ  WRITE

Mon 29 Sep 2003 07:33:07 AM PDT
vol archive          0       750         0       750    0.0    9.0
vol archive-L01      0       384         0       384    0.0    5.9
vol archive-L02      0       366         0       366    0.0   12.1
vol ora02            0       450         0       900    0.0   11.1
vol ora03            0         0         0         0    0.0    0.0
vol ora04            0         0         0         0    0.0    0.0


Mon 29 Sep 2003 07:33:12 AM PDT
vol archive          0       495         0       495    0.0   10.1
vol archive-L01      0       256         0       256    0.0    5.9
vol archive-L02      0       239         0       239    0.0   14.4
vol ora02            0       494         0       988    0.0   10.0
vol ora03            0         0         0         0    0.0    0.0
vol ora04            0         0         0         0    0.0    0.0

For each interval, add the numbers in the blocks written column, but omit any subvolumes. For example, archive-L01, and archive-L02 are subvolumes of the volume archive. The statistics of the writes to the subvolumes are included in the statistics for the volume archive. You may vary the interval, the total time you run the test, and the number of times you run the test according to your needs. In this example, the interval is 5 seconds and the count is in blocks, hence on a machine with 2 kilobytes of block size, the number of megabytes per interval, M, is (total * 2048)/(1024*1024), where total is the sum for one interval. Hence, for one second the number of megabytes is M/5 and the size of the buffer is (M/5)*50. If there is more than one Primary, do not increase the buffer size beyond this number.

DCM Replay Block Size

When the Data Change Map (DCM) is being replayed, data is sent to the Secondary in blocks. The tunable vol_dcm_replay_size enables you to configure the size of the DCM replay blocks according to your network conditions. The default value of vol_dcm_replay_size is 256K. Decreasing the value of the tunable vol_dcm_replay_size may improve performance in a high latency environment.

Heartbeat Timeout

VVR uses a heartbeat mechanism to detect communication failures between the Primary and the Secondary hosts. The RLINKs connect after the heartbeats are exchanged between the Primary and the Secondary. The RLINK remains connected while the heartbeats continue to be acknowledged by the remote host. The maximum interval during which heartbeats can remain unacknowledged is known as the heartbeat timeout value. If the heartbeat is not acknowledged within the specified timeout value, VVR disconnects the RLINK.

The tunable vol_nm_hb_timeout enables you to specify the heartbeat timeout value. The default is 10 seconds. For a high latency network, increasing the default value of the tunable vol_nm_hb_timeout prevents the RLINKs from experiencing false disconnects.

Memory Chunk Size

The tunable voliomem_chunk_size enables you to configure the granularity of memory chunks used by VVR when allocating or releasing system memory. A memory chunk is a contiguous piece of memory that can be written to the disk in one operation. If the write size of the application is larger than the memory chunk size then the write is split resulting in multiple operations, which can reduce performance.

The default memory chunk size is 64K. For applications performing large writes, increase the size of voliomem_chunk_size to improve replication performance. The maximum value of voliomem_chunk_size is 128K.

VVR and Network Address Translation Firewall

VVR uses a heartbeat mechanism to detect communication failures between the Primary and the Secondary hosts. VVR uses IP addresses in the heartbeat message to send heartbeat acknowledgement.

When replicating over a Network Address Translation (NAT) based firewall, VVR must use the translated IP address, instead of the IP address in the heartbeat message. If the IP address in the heartbeat message is used, the heartbeat acknowledgement is dropped at the firewall and replication does not start.

The tunable vol_vvr_use_nat enables VVR to use the translated address from the received message so that VVR can communicate over a NAT-based firewall. Set this tunable to 1 only if there is a NAT-based firewall in the configuration.

 ^ Return to Top Previous  |  Next  >  
Product: Volume Replicator Guides  
Manual: Volume Replicator 4.1 Planning and Tuning Guide  
VERITAS Software Corporation
www.veritas.com