이 기사는 Redis의 Info 명령을 소개합니다. 도움이 되길 바랍니다!
Redis는 Redis 서버에 대한 다양한 정보와 통계 값을 반환하는 info 명령을 제공합니다. Redis를 사용할 때 문제 해결이 필요한 몇 가지 어려운 문제가 자주 발생합니다. 이때 info 명령을 사용하여 Redis의 실행 상태를 확인한 다음 문제를 해결할 수 있습니다. [관련 권장사항: Redis 동영상 튜토리얼]
선택적 매개변수 섹션을 제공하여 명령은 정보의 특정 부분만 반환할 수 있습니다.
server: Redis 서버의 일반 정보
clients: Client 연결 섹션
memory: 메모리 소비 관련 정보
persistence: RDB 및 AOF 관련 정보
stats: 일반 통계
replication: 마스터/슬레이브 복제 정보
cpu : 통계 CPU Consumption
commandstats: Redis 명령 통계
cluster: Redis 클러스터 정보
keyspace: 데이터베이스 관련 통계
다음 값도 사용할 수 있습니다.
매개 변수를 사용하지 않으면 기본값이 기본값이고 모든 정보가 반환됩니다.
Redis 서비스의 모든 정보를 반환합니다
# Server redis_version:6.2.4 redis_git_sha1:00000000 redis_git_dirty:0 redis_build_id:fa652e749408dcfd redis_mode:standalone os:Linux 3.10.0-327.el7.x86_64 x86_64 arch_bits:64 multiplexing_api:epoll atomicvar_api:c11-builtin gcc_version:9.3.1 process_id:4617 process_supervised:no run_id:9662797d01b55345cd6cabad38d102e27db19e66 tcp_port:6379 server_time_usec:1632494557942546 uptime_in_seconds:4 uptime_in_days:0 hz:10 configured_hz:10 lru_clock:5104605 executable:/usr/local/soft/redis-6.2.4/src/redis-server config_file:/usr/local/soft/redis-6.2.4/redis.conf io_threads_active:0 # Clients connected_clients:1 cluster_connections:0 maxclients:10000 client_recent_max_input_buffer:16 client_recent_max_output_buffer:0 blocked_clients:0 tracking_clients:0 clients_in_timeout_table:0 # Memory used_memory:874728 used_memory_human:854.23K used_memory_rss:10207232 used_memory_rss_human:9.73M used_memory_peak:932800 used_memory_peak_human:910.94K used_memory_peak_perc:93.77% used_memory_overhead:830808 used_memory_startup:810168 used_memory_dataset:43920 used_memory_dataset_perc:68.03% allocator_allocated:1036080 allocator_active:1380352 allocator_resident:3932160 total_system_memory:1913507840 total_system_memory_human:1.78G used_memory_lua:37888 used_memory_lua_human:37.00K used_memory_scripts:0 used_memory_scripts_human:0B number_of_cached_scripts:0 maxmemory:104857600 maxmemory_human:100.00M maxmemory_policy:volatile-lfu allocator_frag_ratio:1.33 allocator_frag_bytes:344272 allocator_rss_ratio:2.85 allocator_rss_bytes:2551808 rss_overhead_ratio:2.60 rss_overhead_bytes:6275072 mem_fragmentation_ratio:12.27 mem_fragmentation_bytes:9375272 mem_not_counted_for_evict:0 mem_replication_backlog:0 mem_clients_slaves:0 mem_clients_normal:20496 mem_aof_buffer:0 mem_allocator:jemalloc-5.1.0 active_defrag_running:0 lazyfree_pending_objects:0 lazyfreed_objects:0 # Persistence loading:0 current_cow_size:0 current_cow_size_age:0 current_fork_perc:0.00 current_save_keys_processed:0 current_save_keys_total:0 rdb_changes_since_last_save:0 rdb_bgsave_in_progress:0 rdb_last_save_time:1632494553 rdb_last_bgsave_status:ok rdb_last_bgsave_time_sec:-1 rdb_current_bgsave_time_sec:-1 rdb_last_cow_size:0 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 aof_last_cow_size:0 module_fork_in_progress:0 module_fork_last_cow_size:0 # Stats total_connections_received:1 total_commands_processed:1 instantaneous_ops_per_sec:0 total_net_input_bytes:31 total_net_output_bytes:20324 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:0 expired_stale_perc:0.00 expired_time_cap_reached_count:0 expire_cycle_cpu_milliseconds:0 evicted_keys:0 keyspace_hits:0 keyspace_misses:0 pubsub_channels:0 pubsub_patterns:0 latest_fork_usec:0 total_forks:0 migrate_cached_sockets:0 slave_expires_tracked_keys:0 active_defrag_hits:0 active_defrag_misses:0 active_defrag_key_hits:0 active_defrag_key_misses:0 tracking_total_keys:0 tracking_total_items:0 tracking_total_prefixes:0 unexpected_error_replies:0 total_error_replies:0 dump_payload_sanitizations:0 total_reads_processed:2 total_writes_processed:1 io_threaded_reads_processed:0 io_threaded_writes_processed:0 # Replication role:master connected_slaves:0 master_failover_state:no-failover master_replid:5b43385d46f4a601c025cb2c4ce5706b0b77db86 master_replid2:0000000000000000000000000000000000000000 master_repl_offset:0 second_repl_offset:-1 repl_backlog_active:0 repl_backlog_size:1048576 repl_backlog_first_byte_offset:0 repl_backlog_histlen:0 # CPU used_cpu_sys:0.030666 used_cpu_user:0.000000 used_cpu_sys_children:0.000000 used_cpu_user_children:0.000000 used_cpu_sys_main_thread:0.030570 used_cpu_user_main_thread:0.000000 # Modules # Errorstats # Cluster cluster_enabled:0 # Keyspace db0:keys=2,expires=0,avg_ttl=0
다음은 모든 서버 관련 정보입니다
매개변수 이름 | 의미 |
---|---|
redis_version | Redis 서버 버전 |
redis_git_sha1 | Git SHA1 |
redis_git_dirty | Git 더티 플래그 |
redis_build_ id | 빌드 ID |
redis_mode | 서버 모드( 독립형, 센티널 또는 클러스터) |
os | Redis 서버의 호스트 운영 체제 |
arch_bits | 아키텍처(32 또는 64비트) |
multiplexing_api | Redis에서 사용하는 이벤트 처리 메커니즘 |
atomicvar_api | Redis에서 사용하는 Atomicvar API |
gcc_version | Redis 컴파일 시 사용되는 GCC 버전 |
process_id | 서버 프로세스의 PID |
run_id | Redis 서버의 임의 식별자 전체 및 클러스터) |
tcp_port | TCP/IP 수신 포트 |
uptime_in_seconds | Redis 서버가 시작된 이후 경과된 초 수 |
uptime_in_days | 이후 경과된 초 수 Redis 서버 시작 일수 |
LRU_CLOCK | |
Executable | 서버 실행 가능 파일 경로 |
다음은 모든 클라이언트 관련 정보입니다
매개변수 이름 | 의미 |
---|---|
connected_clients | 연결된 클라이언트 클라이언트 수(슬레이브를 통해 연결된 클라이언트 제외) ) |
client_longest_output_list | 현재 연결된 클라이언트 중 가장 긴 출력 목록 |
client_biggest_input_buf | 현재 연결된 클라이언트 중 가장 큰 입력 캐시 |
blocked_clients | 클라이언트 수 차단된 명령(BLPOP, BRPOP, BRPOPLPUSH) |
다음은 메모리 관련 모든 정보입니다
매개변수 이름 | 의미 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
used_memory | Redis 할당자가 할당한 총 메모리 양 , 바이트 단위(바이트) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
used_memory_human | Redis가 할당한 총 메모리 양을 사람이 읽을 수 있는 형식으로 반환합니다. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
used_memory_rss | 운영 체제 관점에서 Redis가 할당한 총 메모리 양을 반환합니다. Redis(일반적으로 상주 세트 크기로 알려짐). 이 값은 top 및 ps와 같은 명령의 출력과 일치합니다. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
used_memory_peak | Redis의 최대 메모리 소비(바이트) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
used_memory_peak_human | Redis의 최대 메모리 소비를 사람이 읽을 수 있는 형식으로 반환합니다. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
used_memory_peak_perc | 사용된 메모리는 최대 메모리 비율을 차지합니다. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
used_memory_overhead | 내부 데이터 구조를 관리하기 위해 서버에서 할당한 모든 오버헤드의 합계(바이트) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
used_memory_startup | 시작 시 Redis가 소비하는 초기 메모리 크기(바이트) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Used_memory_dataset | 데이터 세트 크기(바이트)(used_memory 빼기 total_system_memory | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
total_system_memory_human | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
used_memory_lua | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
used_memory_lua_ human | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
maxmemory | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
maxmemory_human | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
maxmemory_policy | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
mem_fragmentation_ratio | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
mem_allocator | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
active_defrag_running | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
lazyfree_pending_objects | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
이상적으로는 Used_memory_rss 값이 Used_memory보다 약간만 높아야 합니다. rss > Used 이고 두 값의 차이가 크면 (내부 또는 외부) 메모리 조각화가 있음을 나타냅니다. 메모리 조각화 비율은 mem_fragmentation_ratio 값을 통해 알 수 있습니다. > rss를 사용하면 운영 체제에 의해 Redis 메모리의 일부가 스왑 공간으로 스왑 아웃되었음을 의미합니다. 이 경우 작업이 상당한 지연을 초래할 수 있습니다. Redis는 할당된 메모리가 메모리 페이지에 매핑되는 방식을 제어할 수 없으므로 높은 상주 메모리(used_memory_rss)는 일반적으로 메모리 사용량 급증의 결과입니다. Redis가 메모리를 해제하면 메모리는 할당자로 반환되며, 할당자는 메모리를 운영 체제로 반환할 수도 있고 반환하지 않을 수도 있습니다. Redis가 메모리를 해제하지만 운영 체제에 메모리를 반환하지 않는 경우, Used_memory 값은 운영 체제에 표시되는 Redis의 메모리 사용량과 일치하지 않을 수 있습니다. Used_memory_peak 값을 확인하면 이러한 일이 발생하는지 확인할 수 있습니다. 정보 지속성다음은 모든 지속성 관련 정보입니다.
changes_since_last_save는 SAVE에 대한 마지막 호출 이후의 시간을 나타냅니다. 또는 일부 작업을 생성한 작업 수 BGSAVE 이후 데이터 세트가 변경되었습니다. AOFAOF가 활성화된 경우 다음 추가 필드가 추가됩니다.
loading로드 작업이 진행 중인 경우 다음 추가 필드가 추가됩니다.
status다음은 모든 통계와 관련된 정보입니다.
정보 복제다음은 모든 복제 관련 정보입니다.
인스턴스가 슬레이브인 경우 다음 추가 필드가 제공됩니다.
SYNC 작업이 진행 중인 경우 다음 필드가 제공됩니다.
다음과 같은 연결이 있다면 마스터 및 슬레이브 노드의 연결이 끊어지면 추가 필드가 제공됩니다.
다음 필드는 항상 제공됩니다.
각 슬레이브 노드에 대해 다음을 수행합니다. 라인이 추가됩니다: SlaveXXX ID, 주소, 포트 번호, 상태 info CPU다음은 모든 CPU 관련 정보입니다.
info Clustercluster 섹션에는 현재 하나의 고유 필드만 포함되어 있습니다.
info keyspace keyspace 섹션은 각 데이터베이스의 기본 사전에 대한 통계를 제공합니다. 통계는 총 키 수와 만료된 키의 총 수입니다. 각 데이터베이스에 대해 다음 줄을 제공합니다.
|
위 내용은 Redis의 Info 명령에 대한 심층 분석의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!