gpt4 book ai didi

Redis SETEX 慢

转载 作者:可可西里 更新时间:2023-11-01 11:14:58 28 4
gpt4 key购买 nike

在 redis 4.0.9 中检查我的 SLOWLOG,我发现了这个,db no.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,但还有其他命令可以使它变慢?)

最佳答案

I am not using KEYS, but there are other commands which could make this slow down?

如果它们各自的执行时间很长,slowlog 中的命令就会到达那里 - 其他命令不会影响它(例如 KEYS 或其他任何东西)。

checking my SLOWLOG in redis 4.0.9, I found this

检查 SLOWLOG 是一种很好的做法,应该定期进行。也就是说,由于多种原因,其中的单个慢速命令可能是异常值。除非是病态的,否则我不会担心。

关于Redis SETEX 慢,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52548725/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com