redis最大接続数およびその他のパラメータの表示

3932 ワード

シーン


クラスタプロジェクトは常に接続タイムアウトを報告し、どれだけの接続があるかを見たい.

プロセス


パラメータの接続と表示


クライアントはredisパラメータを見ることができますか?きっとできます.コマンド:
/usr/bin/redis -a ***password  #   redis

パラメータの表示:
info #       
info clients #            ,    server,memory 

infoコマンドエラー:NOAUTH Authentication required.


パスワード接続がなく、infoコマンドを入力すると、このエラーが表示されます.デフォルトの接続方法では表示権限がありません.パスワード付きのログイン方式を使用すればよい.

infoパラメータリスト


infoはすべてのパラメータを表示できます.infoモジュール名は、info server、info memoryなど、対応するモジュールを見ることができます.一般的にinfo clientsコマンドを使えばいいのですが、出力内容は以下の通りです.
# Clients
connected_clients:865  #    
client_recent_max_input_buffer:4
client_recent_max_output_buffer:0
blocked_clients:0

クライアントリスト接続リストの表示


多くのフィールドがあり、ageは作成時間(秒)idleは空き時間(秒)idle時間が長すぎることを表し、ずっと空いていることを表し、age=idleは作成後に使ったことがないことを表し、乾かすことができる

タイムアウト設定の表示

config get timeout  #       
config set timeout 300 #       ( )

config get *   #           

infoすべてのパラメータリスト


すべてのパラメータのリスト:
# Server
redis_version:3.2.12
redis_git_sha1:00000000
redis_git_dirty:0
redis_build_id:7897e7d0e13773f
redis_mode:standalone
os:Linux 3.10.0-957.21.3.el7.x86_64 x86_64
arch_bits:64
multiplexing_api:epoll
gcc_version:4.8.5
process_id:29031
run_id:c810b029bd8eea504cbcd4b466cf1e18c6948f7e
tcp_port:6379
uptime_in_seconds:7308611
uptime_in_days:84
hz:10
lru_clock:13908165
executable:/usr/bin/redis-server
config_file:/etc/redis.conf

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

# Memory
used_memory:813696
used_memory_human:794.62K
used_memory_rss:1810432
used_memory_rss_human:1.73M
used_memory_peak:5022056
used_memory_peak_human:4.79M
total_system_memory:3973533696
total_system_memory_human:3.70G
used_memory_lua:37888
used_memory_lua_human:37.00K
maxmemory:0
maxmemory_human:0B
maxmemory_policy:noeviction
mem_fragmentation_ratio:2.22
mem_allocator:jemalloc-3.6.0

# Persistence
loading:0
rdb_changes_since_last_save:0
rdb_bgsave_in_progress:0
rdb_last_save_time:1590722687
rdb_last_bgsave_status:ok
rdb_last_bgsave_time_sec:0
rdb_current_bgsave_time_sec:-1
aof_enabled:0
aof_rewrite_in_progress:0
aof_rewrite_scheduled:0
aof_last_rewrite_time_sec:-1
aof_current_rewrite_time_sec:-1
aof_last_bgrewrite_status:ok
aof_last_write_status:ok

# Stats
total_connections_received:446262
total_commands_processed:1143019
instantaneous_ops_per_sec:0
total_net_input_bytes:110594091
total_net_output_bytes:724507868
instantaneous_input_kbps:0.00
instantaneous_output_kbps:0.00
rejected_connections:0
sync_full:0
sync_partial_ok:0
sync_partial_err:0
expired_keys:9814
evicted_keys:0
keyspace_hits:54673
keyspace_misses:10209
pubsub_channels:0
pubsub_patterns:0
latest_fork_usec:212
migrate_cached_sockets:0

# Replication
role:master
connected_slaves:0
master_repl_offset:0
repl_backlog_active:0
repl_backlog_size:1048576
repl_backlog_first_byte_offset:0
repl_backlog_histlen:0

# CPU
used_cpu_sys:2315.55
used_cpu_user:1439.36
used_cpu_sys_children:1.90
used_cpu_user_children:1.28

# Cluster
cluster_enabled:0

# Keyspace