You are not logged in.

#1 2013-06-29 10:44:31

kris
Member
Registered: 2011-05-02
Posts: 21

ZFS ate my RAM

System Funtoo with ZFS works OK, but there is one problem - using too much RAM (even more than 90%), and does not decrease.
Are running: KDE-4.10.4, google-chrome, compile www-client/chromium, conky
emerge --info

Portage 2.3.6-r1 (funtoo/1.0/linux-gnu/arch/x86-64bit, gcc-4.6.3, glibc-2.15-r4, 3.9.8-gentoo-kris x86_64)
=================================================================
System uname: Linux-3.9.8-gentoo-kris-x86_64-Intel-R-_Core-TM-2_Quad_CPU_Q6600_@_2.40GHz-with-gentoo-2.2.0
KiB Mem:     4046040 total,    101412 free
KiB Swap:    5242876 total,   5242772 free
Timestamp of tree: Sat, 29 Jun 2013 05:15:01 +0000
ld GNU ld (GNU Binutils) 2.22
app-shells/bash:          4.2_p37
dev-lang/python:          2.7.5-r1000, 3.3.2-r1000
dev-util/cmake:           2.8.11.1
sys-apps/baselayout:      2.2.0-r4
sys-apps/openrc:          0.10.2-r9
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.11.6, 1.12.6
sys-devel/binutils:       2.22-r1
sys-devel/gcc:            4.6.3
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.4-r2 (virtual/os-headers)
sys-libs/glibc:           2.15-r4
Repositories: gentoo
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs buildpkg config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="http://ftp.vectranet.pl/gentoo/ ftp;//mirror.icis.pcz.pl/gentoo/"
LANG="pl_PL.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--sort-common -Wl,--as-needed"
LINGUAS="pl"
MAKEOPTS="-j5 -l5"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="https://github.com/funtoo/ports-2012.git"
SYNC_USER="root"
USE="X a52 aac acl alsa amd64 apng berkdb bzip2 cdr consolekit cracklib crypt css cxx dbus dri dvd dvdr dvdread encode exceptions flac gdbm gif gpm handbook iconv icu ipv6 jpeg kde lame ldap lzma mad mmx modules mp3 mp4 mpeg mudflap multilib ncurses nls nptl ogg opengl openmp pam pcre pdf png policykit pppd python qt3 qt3support qt4 readline resolvconf smp sse sse2 sse3 ssl ssse3 tcpd threads tiff truetype udev unicode userlocales vorbis wavpack win32codecs x264 xml xorg xv zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel ice1724 intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias authn_core authz_core socache_shmcb unixd" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="pl" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-3" PYTHON_ABIS="2.7 3.3" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" QEMU_SOFTMMU_TARGETS="i386 x86_64" QEMU_USER_TARGETS="i386 x86_64" RUBY_TARGETS="ruby18 ruby19" USERLAND="GNU" VIDEO_CARDS="radeon" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, SYNC_UMASK

change permanent vm.swappiness=90, edit the configuration file   /etc/sysctl.conf

top - 11:45:43 up 20 min,  4 users,  load average: 1,21, 0,87, 0,56
Tasks: 229 total,   3 running, 226 sleeping,   0 stopped,   0 zombie
%Cpu(s):  2,6 us,  3,1 sy,  1,3 ni, 88,8 id,  4,1 wa,  0,0 hi,  0,1 si,  0,0 st
KiB Mem:   4046040 total,  3941460 used,   104580 free,      348 buffers
KiB Swap:  5242876 total,     1072 used,  5241804 free,   254024 cached
 
  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND       
12969 root      30  10   23708   1560   1116 R  89,4  0,0   0:03.90 tar           
12968 root      30  10   80708  66652    904 R  70,2  1,6   0:03.02 xz            
    1 root      20   0    4220    656    620 S   0,0  0,0   0:00.63 init          
    2 root      20   0       0      0      0 S   0,0  0,0   0:00.00 kthreadd      
    3 root      20   0       0      0      0 S   0,0  0,0   0:00.02 ksoftirqd/0   

free -m

            total       used       free     shared    buffers     cached
Mem:          3951       3787        164          0          0        259
-/+ buffers/cache:       3527        424
Swap:         5119          1       5118

zfs list

NAME                             USED  AVAIL  REFER  MOUNTPOINT
rpool                           39,9G   106G   136K  none
rpool/FUNTOO                    3,81G   106G   136K  none
rpool/FUNTOO/portage            3,34G   106G   903M  /usr/portage
rpool/FUNTOO/portage/distfiles  1,53G   106G  1,53G  /usr/portage/distfiles
rpool/FUNTOO/portage/packages    943M   106G   943M  /usr/portage/packages
rpool/FUNTOO/src                 483M   106G   483M  /usr/src
rpool/HOME                      28,4G   106G  28,4G  /home
rpool/ROOT                      2,46G   106G   136K  none
rpool/ROOT/funtoo               2,46G   106G  2,46G  /
rpool/swap                      5,16G   111G   413M  -

What is the cause ?

Offline

#2 2013-06-29 19:21:48

leprosys
Member
From: El Salvador
Registered: 2010-10-07
Posts: 54

Offline

#3 2013-06-30 12:57:23

kris
Member
Registered: 2011-05-02
Posts: 21

Re: ZFS ate my RAM

@leprosys
I have read: http://forums.funtoo.org/viewtopic.php?id=2107

sezaru wrote:

I added the arcmax=536870912 to limite the cache to just 512Mb

failed to reduce memory usage, added the arcmax=2147483648 - which is a 2 GB limit for the ARC, there is still no improvement.

Offline

#4 2013-07-01 00:16:45

leprosys
Member
From: El Salvador
Registered: 2010-10-07
Posts: 54

Re: ZFS ate my RAM

I not found a solution for this, my RAM increase with ZFS to 90% or more (8GB of RAM).
Is true arcmax is not a real solution, when my PC is on high usage, my RAM is 100% and my SWAP 10%.
I not found a solution after long time so I stop worrying about this.

Offline

#5 2013-07-09 11:30:31

drumfire
New member
Registered: 2013-06-12
Posts: 9

Re: ZFS ate my RAM

It's not "arcmax" but zfs_arc_max unless you are using the bliss initramfs generator and put this in the kernel's boot arguments. You can check it after booting by issuing 'cat /sys/module/zfs/params/zfs_arc_max'. This is a read-only variable that can only be set on boot.

If you go with less than 4G for ZFS, also try to set zfs_prefetch_disable=1. You can do this after boot as well: 'echo 1 >> /sys/module/zfs/params/zfs_prefetch_disable'

The RAM might be used to a higher degree, but if other programs require RAM, zfs will reduce the RAM it uses to whatever you configured in zfs_arc_max. Additionally, you can echo 3 >> /proc/sys/vm/drop_caches. This forces everything to get rid of its caches. It's documented somewhere in /usr/src/linux/Documentation.

In other words: cache is cache. It's not "unreleasable" RAM usage. ZFS didn't eat it, it nibbled on it wink

Last edited by drumfire (2013-07-09 11:37:16)

Offline

Board footer

Powered by FluxBB