Symptom
Symptom 1: You received an alarm about the outbound traffic being restricted because the outbound traffic metric reached the maximum value allowed.
Symptom 2: The response latency increased.
Possible Causes
Big keys.
If the value of the request key is big, it is easy to cause the problem of high outbound traffic.
Pipeline requests.
Pipeline technology combines multiple requests into one request and send it to the database server for processing, receives all command execution results, and then returns to the upper-layer business. If there are many requests at a time, the outbound traffic will be too high. For more information, see Redis pipelining documentation. Batch query, such as mget, hmget or hgetall, etc.
The number of keys that are queried in a single batch is large, causing the outbound traffic to be too high.
The instance configuration specification is insufficient.
As business and data volume rise, the instance's outbound traffic has reached its upper limit and can’t meet the current business traffic demands.
Solutions
Step 1. Troubleshoot big key issues
1. Log in to the TencentDB for Redis® console, use DBbrain’s Performance Optimization feature to check the big key, and create a big key analysis task, and optimize the big key based on the analysis report. For details, see Memory Analysis. 2. If there is a big key, you can reduce the access to the big key without affecting your business. If the value is too large, you can split the object into multiple key-values so that multiple Redis instances will share the pressure. If there are too many keys, you can store multiple keys in a hash structure.
Note:
In order to prevent the generation of big keys, we recommend that you refer to the following suggestions when designing value.
The string big keys should be under 10 KB in size, and the number of hash, list, set, and zset elements should not exceed 5000.
For non-string big keys, it is recommended to use hscan, sscan, and zscan to delete them progressively.
Step 2. Check whether the business uses pipeline
To check the business code logic, it is recommended not to use pipeline or reduce the number of command requests in each pipeline. If you are unsure whether your business has used the pipeline, submit a ticket for troubleshooting. Step 3. Check the number of keys in a single query
Log in to the TencentDB for Redis® console, use DBbrain’s Performance Optimization feature to analyze the change trend of the performance metrics Key Requests and Mget Executions, and check whether there is a sudden increase in key requests. For directions, see Performance Trends. Generally, it is recommended that the number of keys or elements in a single operation should not exceed 50. If the value is relatively large, you need to reduce it.
Step 4. Upgrade the instance specification
1. Increase the number of replicas as instructed in Changing Instance Specification, enable read-only replicas to share the read load, and transfer the read requests of the current instance to the read-only replica nodes to achieve elastic expansion of read capabilities and improve network traffic performance. For specific operations, see Enabling/Disabling Read/Write Separation. Step 5. Adjust the bandwidth
If the outbound traffic is still high after upgrading the instance specification, you can adjust the bandwidth to its maximum value. Increasing bandwidth is currently free of charge. For directions, see Bandwidth Adjustment.
Was this page helpful?