Jump to content

Redis - how many keys are used by average?


Thomas P

Recommended Posts

Posted

Hi IPS buddies,

how many keys are used by average on Redis on your forums?

I ask because on our environment only about 180 to 190 keys are used during the day, this looks a bit sparse to me.
WordPress for example uses by far more keys...

Thanks,
Thomas 

Posted

Hey folks,

I am not sure if this is a decent amount of keys or if something is going wacky.

So if anyone who is using Redis could please check really quick his numbers please, if would be very thankful.

Thanks,
Thomas

Posted

This is from my stats, I don't know if it is good either:

# Keyspace
db0:keys=633,expires=633,avg_ttl=13932494

I asked many times if people would share advice or their config, but without much luck. I guess most people simply enable it, without care to fine tune it at all. Anyway, here is the full output from redis-cli info on my server:

redis-cli info
# Server
redis_version:4.0.9
redis_git_sha1:00000000
redis_git_dirty:0
redis_build_id:8e246a05989e6d22
redis_mode:standalone
os:Linux 2.6.32-042stab127.2 x86_64
arch_bits:64
multiplexing_api:epoll
atomicvar_api:atomic-builtin
gcc_version:4.8.5
process_id:6321
run_id:48a8a1288bf42b8965ce32c2676d87fbb432a295
tcp_port:6379
uptime_in_seconds:1279121
uptime_in_days:14
hz:10
lru_clock:1909884
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:17348864
used_memory_human:16.55M
used_memory_rss:22564864
used_memory_rss_human:21.52M
used_memory_peak:209709656
used_memory_peak_human:199.99M
used_memory_peak_perc:8.27%
used_memory_overhead:905430
used_memory_startup:782520
used_memory_dataset:16443434
used_memory_dataset_perc:99.26%
total_system_memory:6442450944
total_system_memory_human:6.00G
used_memory_lua:37888
used_memory_lua_human:37.00K
maxmemory:209715200
maxmemory_human:200.00M
maxmemory_policy:allkeys-lru
mem_fragmentation_ratio:1.30
mem_allocator:jemalloc-3.6.0
active_defrag_running:0
lazyfree_pending_objects:0

# Persistence
loading:0
rdb_changes_since_last_save:3113
rdb_bgsave_in_progress:0
rdb_last_save_time:1528636376
rdb_last_bgsave_status:ok
rdb_last_bgsave_time_sec:1
rdb_current_bgsave_time_sec:-1
rdb_last_cow_size:3608576
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

# Stats
total_connections_received:1473435
total_commands_processed:51829601
instantaneous_ops_per_sec:0
total_net_input_bytes:58644875206
total_net_output_bytes:1198627303788
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:409791
expired_stale_perc:0.18
expired_time_cap_reached_count:0
evicted_keys:1571
keyspace_hits:73762530
keyspace_misses:1485737
pubsub_channels:0
pubsub_patterns:0
latest_fork_usec:908
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

# Replication
role:master
connected_slaves:0
master_replid:c242a97523990d983e7c2b19e81266560dbf19b4
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:1961.74
used_cpu_user:1443.72
used_cpu_sys_children:225.97
used_cpu_user_children:1536.40

# Cluster
cluster_enabled:0

# Keyspace
db0:keys=633,expires=633,avg_ttl=13932494

 

Posted

Thank you.

Here is my info:

Quote

# Keyspace

db0:keys=159,expires=148,avg_ttl=23801909

 

Quote

 

# Server

redis_version:4.0.8

redis_git_sha1:00000000

redis_git_dirty:0

redis_build_id:d2758f24a3500f1a

redis_mode:standalone

os:Linux 3.2.60-grsec-x86_64 x86_64

arch_bits:32

multiplexing_api:epoll

atomicvar_api:atomic-builtin

gcc_version:5.4.0

process_id:10145

run_id:ddc6c979ff2c6cc03329122b770d919eb9e9d0e8

tcp_port:6379

uptime_in_seconds:6898138

uptime_in_days:79

hz:10

lru_clock:1921292

executable:/(...)/redis-4.0.8/bin/./redis-server

config_file:/(...)/redis-4.0.8/redis.conf

 

# Clients

connected_clients:1

client_longest_output_list:0

client_biggest_input_buf:0

blocked_clients:0

 

# Memory

used_memory:10616456

used_memory_human:10.12M

used_memory_rss:13889536

used_memory_rss_human:13.25M

used_memory_peak:75745536

used_memory_peak_human:72.24M

used_memory_peak_perc:14.02%

used_memory_overhead:452806

used_memory_startup:392384

used_memory_dataset:10163650

used_memory_dataset_perc:99.41%

total_system_memory:3694194688

total_system_memory_human:3.44G

used_memory_lua:54272

used_memory_lua_human:53.00K

maxmemory:3221225472

maxmemory_human:3.00G

maxmemory_policy:noeviction

mem_fragmentation_ratio:1.31

mem_allocator:jemalloc-4.0.3

active_defrag_running:0

lazyfree_pending_objects:0

 

# Persistence

loading:0

rdb_changes_since_last_save:134

rdb_bgsave_in_progress:0

rdb_last_save_time:1528647788

rdb_last_bgsave_status:ok

rdb_last_bgsave_time_sec:0

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

 

# Stats

total_connections_received:19952765

total_commands_processed:442439004

instantaneous_ops_per_sec:33

total_net_input_bytes:795170300069

total_net_output_bytes:10216739360413

instantaneous_input_kbps:43.34

instantaneous_output_kbps:875.56

rejected_connections:0

sync_full:0

sync_partial_ok:0

sync_partial_err:0

expired_keys:5689718

evicted_keys:0

keyspace_hits:404401432

keyspace_misses:12083007

pubsub_channels:0

pubsub_patterns:0

latest_fork_usec:391

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

 

# Replication

role:master

connected_slaves:0

master_replid:1a37b64e70d4601c2ea614d7eeb18c7a3b42a9db

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:26814.26

used_cpu_user:11677.11

used_cpu_sys_children:314.55

used_cpu_user_children:2051.99

 

# Cluster

cluster_enabled:0

 

 

Now the feeling that something doesn't work ideally on my setup is becoming clear...

Thanks,
Thomas

Posted

Hi,

I switched to Memcached to check what I see there.

Using Memcached shows me 350-370 keys hold in the cache...

-> I really wonder why there are such differences in using caches for different installations and different cache mechanisms.

 

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...