我正在Ubuntu 12.04上从他们的PPA运行ZoL 0.6.2 。它位于具有16GB内存的主机上,旨在使用KVM / Libvirt运行某些VM。一段时间后,ZoL使用了疯狂的内存,在某些VM运行的情况下达到了98%的RAM使用率。这导致新进程拒绝启动“无法分配内存”。我什至无法启动我的所有VM,而在使用ZFS之前,该VM使用了大约40-50%的RAM。
据我了解,在不进行调整的情况下,一旦系统内存不足,ZoL应该立即释放内存。好吧,事实并非如此。因此,我决定将设置设为arc_max
1GB。
# echo 1073741824 >> /sys/module/zfs/parameters/zfs_arc_max
尽管如此,它不会释放任何内存。
从下面的ARC统计数据可以看出,它使用的内存比配置的要多(比较c
= 7572030912
与c_max
= 1073741824
)。
我在这里做错了什么?
# cat /proc/spl/kstat/zfs/arcstats
4 1 0x01 84 4032 43757119584 392054268420115
name type data
hits 4 28057644
misses 4 13975282
demand_data_hits 4 19632274
demand_data_misses 4 571809
demand_metadata_hits 4 6333604
demand_metadata_misses 4 289110
prefetch_data_hits 4 1903379
prefetch_data_misses 4 12884520
prefetch_metadata_hits 4 188387
prefetch_metadata_misses 4 229843
mru_hits 4 15390332
mru_ghost_hits 4 1088944
mfu_hits 4 10586761
mfu_ghost_hits 4 169152
deleted 4 35432344
recycle_miss 4 701686
mutex_miss 4 35304
evict_skip 4 60416647
evict_l2_cached 4 0
evict_l2_eligible 4 3022396862976
evict_l2_ineligible 4 1602907651584
hash_elements 4 212777
hash_elements_max 4 256438
hash_collisions 4 17163377
hash_chains 4 51485
hash_chain_max 4 10
p 4 1527347963
c 4 7572030912
c_min 4 1038188800
c_max 4 1073741824
size 4 7572198224
hdr_size 4 66873056
data_size 4 7496095744
other_size 4 9229424
anon_size 4 169150464
anon_evict_data 4 0
anon_evict_metadata 4 0
mru_size 4 1358216192
mru_evict_data 4 1352400896
mru_evict_metadata 4 508928
mru_ghost_size 4 6305992192
mru_ghost_evict_data 4 4919159808
mru_ghost_evict_metadata 4 1386832384
mfu_size 4 5968729088
mfu_evict_data 4 5627991552
mfu_evict_metadata 4 336846336
mfu_ghost_size 4 1330455552
mfu_ghost_evict_data 4 1287782400
mfu_ghost_evict_metadata 4 42673152
l2_hits 4 0
l2_misses 4 0
l2_feeds 4 0
l2_rw_clash 4 0
l2_read_bytes 4 0
l2_write_bytes 4 0
l2_writes_sent 4 0
l2_writes_done 4 0
l2_writes_error 4 0
l2_writes_hdr_miss 4 0
l2_evict_lock_retry 4 0
l2_evict_reading 4 0
l2_free_on_write 4 0
l2_abort_lowmem 4 0
l2_cksum_bad 4 0
l2_io_error 4 0
l2_size 4 0
l2_asize 4 0
l2_hdr_size 4 0
l2_compress_successes 4 0
l2_compress_zeros 4 0
l2_compress_failures 4 0
memory_throttle_count 4 0
duplicate_buffers 4 0
duplicate_buffers_size 4 0
duplicate_reads 4 0
memory_direct_count 4 66583
memory_indirect_count 4 7657293
arc_no_grow 4 0
arc_tempreserve 4 0
arc_loaned_bytes 4 0
arc_prune 4 0
arc_meta_used 4 427048272
arc_meta_limit 4 2076377600
arc_meta_max 4 498721632
# free -m
total used free shared buffers cached
Mem: 15841 15385 456 0 75 74
-/+ buffers/cache: 15235 606
Swap: 0 0 0
make static; strip -s killmem
)