TcaplusDB OMS Console - Set Read Shunt
1. Function Descriptions
Table read shunt refers to sending the read request of the service to tcapsvr_slave, and tcapsvr_slave processes these request packets to reduce the processing pressure of tcapsvr_master and prevent overloading.
Tables that meet the following conditions can or need read shunting:
The processing capacity of tcapsvr_master is close to the upper limit, and the processing pressure needs to be relieved quickly;
App read requests account for a large proportion of the total access;
Apps can accept that tables are downgraded from strong consistency to final consistency.
Currently, requests for the following commands can be shunted to tcapsvr_slave:
- TCAPLUS_API_GET_REQ
- TCAPLUS_API_GET_TABLE_RECORD_COUNT_REQ
- TCAPLUS_API_LIST_GET_REQ
- TCAPLUS_API_LIST_GETALL_REQ
- TCAPLUS_API_GET_BY_PARTKEY_REQ
- TCAPLUS_API_BATCH_GET_BY_PARTKEY_REQ
- TCAPLUS_API_METADATA_GET_REQ
- TCAPLUS_API_TABLE_TRAVERSE_REQ
- TCAPLUS_API_LIST_TABLE_TRAVERSE_REQ
- TCAPLUS_API_BATCH_GET_REQ
2. Steps
There are two ways to set the read shunt:
Set the read shunt on the API side. It can set the read shunt in the function TcaplusServiceRequest::SetFlags().
On the TcaplusDB OMS page, it can set the read shunt for some apps, zones, and tables, as well as the time period, command, proportion, and whether to retry to the tcapsvr_master.
If the read shunt setting on the API side is inconsistent with the read shunt setting on the TcaplusDB OMS side, the read shunt setting on the API side will prevail.