首页 文章

Redis上的“连接被拒绝”错误

提问于
浏览
0

我在局域网上运行Redis实例(v2.8),可以通过LAN IP和localhost工作和访问 . 问题是我们从客户端获得随机的“连接拒绝”错误 . 他们多次成功,但经常发生失败 .

Redis中没有错误 . 它没有报告任何被拒绝的连接,所以我在Linux中做了些什么 . 请参阅下面的INFO输出:

info
# Server
redis_version:2.8.0
redis_git_sha1:00000000
redis_git_dirty:0
redis_build_id:8c972dc122b48b0
redis_mode:standalone
os:Linux 3.2.0-56-generic x86_64
arch_bits:64
multiplexing_api:epoll
gcc_version:4.6.3
process_id:32455
run_id:c2536f78b7277e44bb03d1872bb0ede6764bd719
tcp_port:6379
uptime_in_seconds:531319
uptime_in_days:6
hz:10
lru_clock:204248
config_file:/etc/redis/redis.conf

# Clients
connected_clients:11
client_longest_output_list:0
client_biggest_input_buf:0
blocked_clients:0

# Memory
used_memory:20166048208
used_memory_human:18.78G
used_memory_rss:20565544960
used_memory_peak:20171368288
used_memory_peak_human:18.79G
used_memory_lua:33792
mem_fragmentation_ratio:1.02
mem_allocator:jemalloc-3.4.1

# Persistence
loading:0
rdb_changes_since_last_save:548
rdb_bgsave_in_progress:0
rdb_last_save_time:1386162582
rdb_last_bgsave_status:ok
rdb_last_bgsave_time_sec:142
rdb_current_bgsave_time_sec:-1
aof_enabled:1
aof_rewrite_in_progress:0
aof_rewrite_scheduled:0
aof_last_rewrite_time_sec:104
aof_current_rewrite_time_sec:-1
aof_last_bgrewrite_status:ok
aof_current_size:10938614211
aof_base_size:5791948107
aof_pending_rewrite:0
aof_buffer_length:0
aof_rewrite_buffer_length:0
aof_pending_bio_fsync:0
aof_delayed_fsync:4616

# Stats
total_connections_received:1024359
total_commands_processed:500283574
instantaneous_ops_per_sec:88
rejected_connections:0
sync_full:1
sync_partial_ok:5
sync_partial_err:0
expired_keys:79
evicted_keys:0
keyspace_hits:225004198
keyspace_misses:17265265
pubsub_channels:0
pubsub_patterns:0
latest_fork_usec:294076

# Replication
role:master
connected_slaves:1
slave0:ip=192.168.0.203,port=6379,state=online,offset=13777559286,lag=1
master_repl_offset:13777559286
repl_backlog_active:1
repl_backlog_size:1048576
repl_backlog_first_byte_offset:13776510711
repl_backlog_histlen:1048576

# CPU
used_cpu_sys:4233.39
used_cpu_user:5293.61
used_cpu_sys_children:5679.02
used_cpu_user_children:115598.34

# Keyspace
db0:keys=73514342,expires=10,avg_ttl=39196243

我只看到大约50个并发连接偶尔爆发,所以我认为我没有达到任何文件描述符限制 . 我已将软限制提高到90,000个描述符 . sysctl fs.file-max设置也非常高 .

sysctl fs.file-max
fs.file-max = 1622320

我们没有使我们的100Mb / s LAN线路饱和 . 那么问题是什么?我们经常收到用户抱怨“拒绝连接”错误的门票 .

1 回答

  • 0

    检查你的“绑定”配置 .

    也许仅限于localhost,您必须打开您的网络 . 在您的配置文件中:

    bind * 
    # instead of bind 127.0.0.1
    

相关问题