Redis: Overcoming the 10060 Error(redis10060)

# Redis: Overcoming the 10060 Error

Have you ever used Redis and encountered the 10060 error? Well, I’m here to tell you it’s not as scary as it looks and that there are ways to workaround this Redis error.

Before we get into the technical settings to use for overcoming the 10060 error, let’s first examine the actual Redis code line responsible for the error. In Redis, the 10060 error is caused when an attempt to initiate a TCP connection is refused by a remote computer, or host. The following is an example of the error generated when using Redis as a remote database:

Error: Error 10060 connecting to myredis.com:6379.

There are several settings which can help you get around the 10060 error, however the main solution is to set the `maxclients` setting. This setting controls the number of TCP connections to the Redis instance. The maxclients setting needs to be large enough so that, even when 10060 is encountered, there are still available connections available. The default `maxclients` setting is set to 1024 connections but it is common to increase this value for high-density workloads.

Another potential workaround for the 10060 error is to reduce the minimum client idle time setting, or `timeout`. The `timeout` value specifies the number of seconds that a TCP connection can stay idle before Redis closes it. The default value is 300 seconds. Setting the `timeout` value to a smaller value may help to reduce the occurrence of the error.

In some cases, the 10060 error may be a result of a firewall or overaggressive security software present on the remote computer. If none of the above-mentioned settings help to resolve the 10060 error then the issue may be related to a firewall issue. In these cases it is necessary to configure the applicable firewall or security software settings to allow incoming connections to the Redis port.

Regardless of the cause of the Redis 10060 error, the settings described above should help overcome this issue. Redis is a powerful, flexible tool which can provide low-latency performance on large-scale workloads. Following the steps outlined in this article, you can work around the 10060 error and continue to use Redis effectively.


数据运维技术 » Redis: Overcoming the 10060 Error(redis10060)