在redis 4.0.9中检查我的SLOWLOG,我发现了这个,数据库编号1:
1) 1) (integer) 5194
2) (integer) 1538107771
3) (integer) 140185
4) 1) "SETEX"
2) "okurl:/en/7055756"
3) "3600"
4) "1"
5) "172.20.100.4:24784"
6) ""
我想知道,什么可能导致这种情况。信息:
# Server
redis_version:4.0.9
redis_git_sha1:00000000
redis_git_dirty:0
redis_build_id:2fd2284b20453690
redis_mode:standalone
os:FreeBSD 11.2-PRERELEASE amd64
arch_bits:64
multiplexing_api:kqueue
atomicvar_api:atomic-builtin
gcc_version:4.2.1
process_id:40220
run_id:ec7f3e8144a681f0efca5e980ccdf39b8a8fdb71
tcp_port:6379
uptime_in_seconds:81007
uptime_in_days:0
hz:10
lru_clock:11384428
executable:/usr/local/bin/redis-server
config_file:/usr/local/etc/redis-sessions.conf
# Clients
connected_clients:429
client_longest_output_list:0
client_biggest_input_buf:0
blocked_clients:0
# Memory
used_memory:5749433062
used_memory_human:5.35G
used_memory_rss:5746385347
used_memory_rss_human:5.35G
used_memory_peak:30520735162
used_memory_peak_human:28.42G
used_memory_peak_perc:18.84%
used_memory_overhead:1280922380
used_memory_startup:1055278
used_memory_dataset:4468510682
used_memory_dataset_perc:77.74%
total_system_memory:0
total_system_memory_human:0B
used_memory_lua:142448640
used_memory_lua_human:135.85M
maxmemory:0
maxmemory_human:0B
maxmemory_policy:noeviction
mem_fragmentation_ratio:1.00
mem_allocator:libc
active_defrag_running:0
lazyfree_pending_objects:0
# Persistence
loading:0
rdb_changes_since_last_save:28274431
rdb_bgsave_in_progress:0
rdb_last_save_time:1538107772
rdb_last_bgsave_status:ok
rdb_last_bgsave_time_sec:35
rdb_current_bgsave_time_sec:-1
rdb_last_cow_size:0
aof_enabled:0
# Stats
total_connections_received:232817201
total_commands_processed:1640805022
instantaneous_ops_per_sec:22264
total_net_input_bytes:116006836822
total_net_output_bytes:56698168188
instantaneous_input_kbps:1470.51
instantaneous_output_kbps:639.40
rejected_connections:0
sync_full:0
sync_partial_ok:0
sync_partial_err:0
expired_keys:28093034
expired_stale_perc:29.33
expired_time_cap_reached_count:0
evicted_keys:0
keyspace_hits:399489929
keyspace_misses:93415724
pubsub_channels:0
pubsub_patterns:0
latest_fork_usec:645655
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
# Keyspace
db0:keys=8517091,expires=8516507,avg_ttl=14897082
db1:keys=4938456,expires=4805686,avg_ttl=1455726323
也许是正当Redis将转储文件写入文件系统时造成的,所以它变慢了吗?或者可能是其他一些阻止命令正在运行? (我没有使用KEYS,但是还有其他命令可能会使速度变慢?)
答案 0 :(得分:1)
我没有使用KEYS,但是还有其他命令可能会使速度变慢?
如果它们各自的执行时间很长,则慢日志中的命令会到达那里-其他命令不会对此产生影响(例如KEYS或其他任何东西)。
在redis 4.0.9中检查我的SLOWLOG,我发现了
检查SLOWLOG是一个好习惯,应该定期进行。就是说,其中的一个缓慢命令可能是由于多种原因造成的异常。除非它是病理性的,否则我不会担心。