DRBD-optimized performance

Source: Internet
Author: User

Test throughput:
The test system throughput is not critical, and the most important is the impact before and after the use of DRBD performance. This test uses a m block to the drbd device for comparative testing.

#! /Bin/bash
Resource = r0
Test_device = 'drbdadm sh-dev $ resource'
Test_ll_device = 'drbdadm sh-ll-dev $ resource'
Drbdadm primary $ resource
For I in $ (seq 5)
Do
Dd if =/dev/zero of = $ test_device bs = 512 M count = 1 oflag = direct
Done
Drbdadm down $ resource
For I in $ (seq 5)
Do
Dd if =/dev/zero of = $ test_ll_device bs = 512 M count = 1 oflag = direct
Done
Drbdadm up $ resource

Note:
1. dd should use the keyword oflag = direct to ignore the influence of cache when writing files. There is also an optional keyword iflag = directio, which is used to control the read and write modes of source and target files as directio;
2. The above scripts require testing when two roles are secondary;
3. After the test, the system prompts "mount: you must specify the filesystem type" when setting the primary node and mounting/dev/drbd0. you Need To reformat/dev/drbd0.
Optimization:
This mainly depends on hardware, disk speed, and network throughput,
Suggested parameter adjustment:
 
Net {
Max-buffers 8000;
Max-epoch-size 8000;
Sndbuf-size 0;
}

Max-buffers: the maximum number of data written to the disk buffer by drbd. The default value is 2048;
Max-epoch-size is the maximum number of writes allowed for two write bottlenecks;
Sndbuf-size: Specifies the size of the TCP sending buffer, which is set to 0 and can be adjusted automatically;
 
Syncer {
Rate 90 M;
Al-extents 257;
}

Al-extents: the size of the active log, the number of x4M blocks; the benefit of increasing this value is:
Reduces the frequency of updating metadata to a drbd device;
Reduces the number of IO streams interrupted during data synchronization;
Increase the speed of the drbd device;
The risk is that after primary node crash, all the active data (al-extentsx 4 M block) needs to be re-synchronized. This time secondary node is in the outdate state and the repair time is longer;
Set the sync rate parameter. Only the backgroud re-synchronization parameter is limited by the setting of this parameter. The other synchronization process is only responsible for synchronizing some block changes without limiting this parameter; therefore, do not set too many values to avoid occupying too much bandwidth, resulting in IO synchronization exceptions;

Disk {
On-io-error detach;
Disk-flushes no;
}

The disk should consider not less than 6 15 K sas disks for raid 10, or use ssd directly. If the raid card has bbu battery protection, you can consider prohibiting disk flushing of drbd;
You can refer to the recommendations on the official website to change the IO scheduling algorithm:
Echo deadline>/sys/block/<device>/queue/scheduler (deadline can be used for sas disks; noop scheduling algorithm can be used for ssd disks)

DRBD for Linux high availability (HA) CLUSTERS

DRBD Chinese application guide PDF

Installation and configuration notes for DRBD in CentOS 6.3

High-availability MySQL based on DRBD + Corosync

Install and configure DRBD in CentOS 6.4

DRBD details: click here
DRBD: click here

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.