microsoftarchive / redis

Redis is an in-memory database that persists on disk. The data model is key-value, but many different kind of values are supported: Strings, Lists, Sets, Sorted Sets, Hashes
http://redis.io
Other
20.81k stars 5.37k forks source link

Redis failed to fork #444

Open huhm opened 8 years ago

huhm commented 8 years ago

Client Version : Redis-x64-3.0.501 Redis Restarted once,what should I do to avoid this? The Log:

[5052] 08 Apr 19:26:22.109 # GetPerformanceInfo failed.

[5052] 08 Apr 19:26:22.110 # Failing startup.

[5880] 08 Apr 19:26:22.135 # fork operation failed
[5880] 08 Apr 19:26:22.136 # Background saving terminated by signal 1
[5880] 08 Apr 19:26:28.070 * 10 changes in 300 seconds. Saving...
[5880] 08 Apr 19:26:28.072 * Background saving started by pid 2856
[2856] 08 Apr 19:26:28.184 # 
The Windows version of Redis reserves heap memory from the system paging file
for sharing with the forked process used for persistence operations.At this time there is insufficient contiguous free space available in the
system paging file. You may increase the size of the system paging file.
Sometimes a reboot will defragment the system paging file sufficiently for
this operation to complete successfully.

Redis can not continue. Exiting.
[5880] 08 Apr 19:26:28.273 # fork operation failed
[5880] 08 Apr 19:26:28.274 # Background saving terminated by signal 1
[5880] 08 Apr 19:26:34.004 * 10 changes in 300 seconds. Saving...
[5880] 08 Apr 19:26:34.005 * Background saving started by pid 6356
[6356] 08 Apr 19:26:34.086 # 
The Windows version of Redis reserves heap memory from the system paging file
for sharing with the forked process used for persistence operations.At this time there is insufficient contiguous free space available in the
system paging file. You may increase the size of the system paging file.
Sometimes a reboot will defragment the system paging file sufficiently for
this operation to complete successfully.

Redis can not continue. Exiting.
[5880] 08 Apr 19:26:34.107 # fork operation failed
[5880] 08 Apr 19:26:34.109 # Background saving terminated by signal 1
[5880] 08 Apr 19:26:40.049 * 10 changes in 300 seconds. Saving...
[5880] 08 Apr 19:26:40.051 * Background saving started by pid 1216
[1216] 08 Apr 19:26:40.117 # 
The Windows version of Redis reserves heap memory from the system paging file
for sharing with the forked process used for persistence operations.At this time there is insufficient contiguous free space available in the
system paging file. You may increase the size of the system paging file.
Sometimes a reboot will defragment the system paging file sufficiently for
this operation to complete successfully.

Redis can not continue. Exiting.
[5880] 08 Apr 19:26:40.151 # fork operation failed
[5880] 08 Apr 19:26:40.152 # Background saving terminated by signal 1
[5880] 08 Apr 19:26:46.080 * 10 changes in 300 seconds. Saving...
[5880] 08 Apr 19:26:46.082 * Background saving started by pid 7076
[7076] 08 Apr 19:26:46.166 # 
The Windows version of Redis reserves heap memory from the system paging file
for sharing with the forked process used for persistence operations.At this time there is insufficient contiguous free space available in the
system paging file. You may increase the size of the system paging file.
Sometimes a reboot will defragment the system paging file sufficiently for
this operation to complete successfully.

Redis can not continue. Exiting.
[5880] 08 Apr 19:26:46.183 # fork operation failed
[5880] 08 Apr 19:26:46.185 # Background saving terminated by signal 1
[5880] 08 Apr 19:26:52.018 * 10 changes in 300 seconds. Saving...
[5880] 08 Apr 19:26:52.020 * Background saving started by pid 1700
[1700] 08 Apr 19:26:52.100 # 
The Windows version of Redis reserves heap memory from the system paging file
for sharing with the forked process used for persistence operations.At this time there is insufficient contiguous free space available in the
system paging file. You may increase the size of the system paging file.
Sometimes a reboot will defragment the system paging file sufficiently for
this operation to complete successfully.

Redis can not continue. Exiting.
[5880] 08 Apr 19:26:52.122 # fork operation failed
[5880] 08 Apr 19:26:52.123 # Background saving terminated by signal 1
[5880] 08 Apr 19:26:58.045 * 10 changes in 300 seconds. Saving...
enricogior commented 8 years ago

Hi @huhm have you changed the default Windows system paging file settings?

huhm commented 8 years ago

I have not set the Windows system paging file settings. I checked the setting that all the disk is seted to no system paging file. Should I set the system paging file to custom size?

enricogior commented 8 years ago

@huhm how much physical memory does the machine have? Connect to the server using redis-cli, run the INFO command and please report the Memory data. Thank you.

huhm commented 8 years ago

The Memory info:

# Memory
used_memory:2091072
used_memory_human:1.99M
used_memory_rss:2053288
used_memory_peak:2248120
used_memory_peak_human:2.14M
used_memory_lua:36864
mem_fragmentation_ratio:0.98
mem_allocator:jemalloc-3.6.0
enricogior commented 8 years ago

@huhm given Redis is using only 2MB of memory, there is no plausible reason why the for operation would fail. There might be something wrong with your system paging file configuration, but that is just a guess based on the reported error. What version of Windows are you using?

huhm commented 8 years ago

My system version is : Windows Server 2008 R2 Standard (Service Pack 1) Here is the other info:

# Server
redis_version:3.0.501
redis_git_sha1:00000000
redis_git_dirty:0
redis_build_id:ba05b51e58eb9205
redis_mode:standalone
os:Windows
arch_bits:64
multiplexing_api:WinSock_IOCP
process_id:5880
run_id:2de1d97eca169d85acac4dd592f9bb7aeda18d3d
tcp_port:6379
uptime_in_seconds:3138943
uptime_in_days:36
hz:10
lru_clock:578769
config_file:D:\Redis\Redis-x64-3.0.501\redis.windows-service.conf

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

# Memory
used_memory:2172144
used_memory_human:2.07M
used_memory_rss:2134360
used_memory_peak:2296968
used_memory_peak_human:2.19M
used_memory_lua:36864
mem_fragmentation_ratio:0.98
mem_allocator:jemalloc-3.6.0

# Persistence
loading:0
rdb_changes_since_last_save:2054
rdb_bgsave_in_progress:0
rdb_last_save_time:1460196390
rdb_last_bgsave_status:ok
rdb_last_bgsave_time_sec:0
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
aof_last_write_status:ok

# Stats
total_connections_received:11921
total_commands_processed:17472830
instantaneous_ops_per_sec:11
total_net_input_bytes:2523131043
total_net_output_bytes:449905376
instantaneous_input_kbps:1.40
instantaneous_output_kbps:5.07
rejected_connections:0
sync_full:0
sync_partial_ok:0
sync_partial_err:0
expired_keys:25200
evicted_keys:0
keyspace_hits:3700422
keyspace_misses:73490
pubsub_channels:2
pubsub_patterns:0
latest_fork_usec:0
migrate_cached_sockets:0

# Replication
role:master
connected_slaves:0
master_repl_offset:0
repl_backlog_active:0
repl_backlog_size:1048576
repl_backlog_first_byte_offset:0
repl_backlog_histlen:0

# CPU
used_cpu_sys:987.28
used_cpu_user:937.97
used_cpu_sys_children:0.00
used_cpu_user_children:0.00

# Cluster
cluster_enabled:0

# Keyspace
db0:keys=1464,expires=1172,avg_ttl=39807582
db1:keys=2,expires=0,avg_ttl=0
db2:keys=488,expires=0,avg_ttl=0
db3:keys=30,expires=30,avg_ttl=40952053 
enricogior commented 8 years ago

@huhm everything seems ok, it's hard to diagnose the problem given the error is caused by a system call that fails for unknown reason.