Why Do I Need to Configure Timeout for Redis Cluster?
If timeout is not configured, connections will fail.
When you connect to a Redis Cluster instance using Spring Boot and Lettuce, connect to all cluster nodes, including faulty replicas.
- If timeout is not configured, minute-level blocking (120s in earlier Lettuce versions and 60s in the new version) may occur when there is a faulty replica, as shown in the following figure.
The end-to-end service access time may reach the maximum timeout, as shown in the following figure.
- After the timeout parameter is configured on the client, the timeout on the replica will be greatly shortened. You can adjust the timeout based on the service requirements. Assume that the configuration is as follows.
The following figure shows the end-to-end service access time after the configuration is complete.
If the timeout parameter is not configured and there is a faulty node, client connections will be blocked.
Configure the timeout based on what the service can tolerate. For example, if you need to request Redis twice in an HTTP request and the maximum timeout of an HTTP request is 10s, it is recommended that you set the timeout in Redis to 5s. This prevents service interruption if faults occur due to a long timeout duration or no timeout duration.
Redis Usage FAQs
- Can I Change the CPU Architecture?
- Can I Change the AZ for an Instance?
- Can I Change the VPC and Subnet for a DCS Redis Instance?
- Can I Customize or Change the Port for Accessing a DCS Instance?
- Can I Modify the Connection Addresses for Accessing a DCS Instance?
- Why Do I Fail to Delete an Instance?
- Why Does It Take a Long Time to Start a Cluster DCS Instance?
- What Should I Do If an Error Occurs in redis_exporter?
- What Is Reserved Memory? How Do I Configure Reserved Memory?
- Why Is Available Memory Smaller Than Instance Cache Size?
- Why Is Redisson Distributed Lock Not Supported by DCS Proxy Cluster Redis 3.0 Instances?
- Does DCS for Redis Provide Backend Management Software?
- Can I Recover Deleted Data of a DCS Instance?
- Why Is Available Memory of Unused DCS Instances Less Than Total Memory and Why Is Memory Usage of Unused DCS Instances Greater Than Zero?
- How Do I Check Redis Memory Usage?
- Why Is the Capacity or Performance of a Shard of a Redis Cluster Instance Overloaded When That of the Instance Is Still Below the Bottleneck?
- Why Does an OOM Error Occur During a Redis Connection?
- What Clients Can I Use for Redis Cluster in Different Programming Languages?
- Why Do I Need to Configure Timeout for Redis Cluster?
- Why Am I Seeing a Timeout Error When Reading Data from Redis?
- Explaining and Using Hash Tags
- Why Does a Key Disappear in Redis?
- Will Cached Data Be Retained After an Instance Is Restarted?
- How Do I Know Whether an Instance Is Single-DB or Multi-DB?
- What Are the Constraints on Implementing Multi-DB on a Proxy Cluster Instance?
- How Do I Create a Multi-DB Proxy Cluster Instance?
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbotmore