Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

High memory use for initial DB save #1211

Open
svend opened this Issue · 0 comments

1 participant

@svend

For a 2.6.7 slave, the initial DB save uses 5.5 GB of memory by copy-on-write. Subsequent saves use about 40 MB. What is the reason for the high memory usage for the initial save?

[980] 23 Jul 14:33:03.620 # Server started, Redis version 2.6.7
[980] 23 Jul 14:34:54.358 * DB loaded from disk: 110.737 seconds
[980] 23 Jul 14:34:54.358 * The server is now ready to accept connections on port 6379
[980] 23 Jul 14:34:54.358 * The server is now ready to accept connections at /var/run/redis/redis.sock
[980] 23 Jul 14:34:54.360 * Connecting to MASTER...
[980] 23 Jul 14:34:54.361 * MASTER <-> SLAVE sync started
[980] 23 Jul 14:34:54.362 * Non blocking connect for SYNC fired the event.
[980] 23 Jul 14:34:54.362 * Master replied to PING, replication can continue...
[980] 23 Jul 14:36:18.282 * MASTER <-> SLAVE sync: receiving 3196389390 bytes from master
[980] 23 Jul 14:37:36.923 * MASTER <-> SLAVE sync: Loading DB in memory
[980] 23 Jul 14:39:51.881 * MASTER <-> SLAVE sync: Finished with success
[980] 23 Jul 14:39:51.895 * 10 changes in 300 seconds. Saving...
[980] 23 Jul 14:39:52.010 * Background saving started by pid 2341
[2341] 23 Jul 14:41:18.743 * DB saved on disk
[2341] 23 Jul 14:41:18.892 * RDB: 5655 MB of memory used by copy-on-write
[980] 23 Jul 14:41:19.986 * Background saving terminated with success
[980] 23 Jul 14:42:20.009 * 10000 changes in 60 seconds. Saving...
[980] 23 Jul 14:42:20.262 * Background saving started by pid 2371
[2371] 23 Jul 14:43:42.376 * DB saved on disk
[2371] 23 Jul 14:43:42.480 * RDB: 40 MB of memory used by copy-on-write
[980] 23 Jul 14:43:42.697 * Background saving terminated with success
$ redis-cli info
# Server
redis_version:2.6.7
redis_git_sha1:00000000
redis_git_dirty:0
redis_mode:standalone
os:Linux 3.2.0-29-virtual x86_64
arch_bits:64
multiplexing_api:epoll
gcc_version:4.6.3
process_id:980
run_id:861a1130e48c81aa0cbfc5f7495219a7557fb3f7
tcp_port:6379
uptime_in_seconds:2966
uptime_in_days:0
lru_clock:1146934

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

# Memory
used_memory:7046475560
used_memory_human:6.56G
used_memory_rss:8674299904
used_memory_peak:7274371848
used_memory_peak_human:6.77G
used_memory_lua:31744
mem_fragmentation_ratio:1.23
mem_allocator:libc

# Persistence
loading:0
rdb_changes_since_last_save:7438
rdb_bgsave_in_progress:0
rdb_last_save_time:1374618082
rdb_last_bgsave_status:ok
rdb_last_bgsave_time_sec:82
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

# Stats
total_connections_received:98251
total_commands_processed:425649
instantaneous_ops_per_sec:123
rejected_connections:0
expired_keys:0
evicted_keys:0
keyspace_hits:31683
keyspace_misses:61760
pubsub_channels:0
pubsub_patterns:0
latest_fork_usec:127912

# Replication
role:slave
master_host:redis0
master_port:6379
master_link_status:up
master_last_io_seconds_ago:0
master_sync_in_progress:0
slave_priority:100
slave_read_only:1
connected_slaves:0

# CPU
used_cpu_sys:73.56
used_cpu_user:264.58
used_cpu_sys_children:121.60
used_cpu_user_children:963.42

# Keyspace
db7:keys=21088517,expires=21088517
@JackieXie168 JackieXie168 referenced this issue from a commit
@wmrowan wmrowan fixes #1211 8785200
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.