This topic describes how to check the NIC rate of a cluster.
Scenarios
This inspection item checks whether an OceanBase cluster can obtain the NIC rate based on which the cluster handles data transmission between nodes.
Prerequisites
None.
Technical mechanism
An OceanBase cluster first obtains the configured NIC rate from the nic.rate.config file in the {WORK_DIR}/etc/ directory. If this configuration file does not exist, the OceanBase cluster attempts to query the NIC rate from the operating system. If the NIC rate is still not obtained, the default rate is used. In most cases, the default rate is inconsistent with the actual rate. As a result, the data migration and replication is slow, which leads to a great latency between primary and standby databases and eventually causes serious problems.
Procedure
If this inspection item fails, we recommend that you add the nic.rate.config file to the {WORK_DIR}/etc/ directory of the OceanBase cluster and specify the NIC rate in the $(IF_NAME)=$(SPEED) format. The value of SPEED can be only a number, or a number with a unit. If you specify only a number, the unit is Mbps by default. Here are some sample configurations:
bond0=10000
bond0=10000b
bond0=10000bit
bond0=10000k
bond0=10000kb
bond0=10000kbit
bond0=10000m
bond0=10000mb
bond0=10000mbit
bond0=100g
bond0=100gb
bond0=100gbit
You can run the following command to check the logs and confirm whether the modified NIC rate takes effect:
# grep -E "network speed changed|reload_bandwidth_throttle_limit|init_bandwidth_throttle" log/observer.log.202106101*
log/observer.log.20210610111947:[2021-06-10 11:10:49.397019] INFO [SERVER] ob_server.cpp:2018 [72580][0][Y0-0000000000000000-0-0] [lt=8] [dc=0] succeed to init_bandwidth_throttle(sys_bkgd_net_percentage_=60, network_speed=1310720000, rate=786432000)
log/observer.log.20210610111947:[2021-06-10 11:14:44.905396] INFO [SERVER] ob_server.cpp:2385 [72582][0][Y0-0000000000000000-0-0] [lt=11] [dc=0] network speed changed(from=1310720000, to=1048576000)
log/observer.log.20210610111947:[2021-06-10 11:14:44.905421] INFO [SERVER] ob_server.cpp:2055 [72582][0][Y0-0000000000000000-0-0] [lt=3] [dc=0] succeed to reload_bandwidth_throttle_limit(old_percentage=60, new_percentage=60, network_speed=1048576000, rate=629145600)
If the rate format is incorrect, the following error log is returned:
[2021-06-10 15:28:02.999345] ERROR [SERVER] get_network_speed_from_config_file (ob_server.cpp:1979) [99676][0][Y0-0000000000000000-0-0] [lt=14] [dc=0] invalid NIC Config file(ret=-4002) BACKTRACE:0xfbd452b 0x3d6c7f4 0x3eeab15 0x3eea4c2 0x3eea154 0x3ee9b90 0xadfc5c2 0xadfbc57 0xae01372 0xae0118d 0xfb3a316 0x483b9c7 0x483b929 0xf9e59de 0xf9e587d 0xb37edee 0xf9e5d3c 0xf9e5d15 0xf9e50b9 0xf9de0af