{"id":735,"date":"2013-02-18T20:35:08","date_gmt":"2013-02-18T18:35:08","guid":{"rendered":"http:\/\/www.shukko.com\/x3\/?p=735"},"modified":"2013-02-18T20:35:08","modified_gmt":"2013-02-18T18:35:08","slug":"native-zfs-for-linux-on-proxmox-and-zfs-eating-memory","status":"publish","type":"post","link":"https:\/\/www.shukko.com\/x3\/2013\/02\/18\/native-zfs-for-linux-on-proxmox-and-zfs-eating-memory\/","title":{"rendered":"native zfs for linux on proxmox and zfs eating memory"},"content":{"rendered":"<p>original url: http:\/\/ispire.me\/native-zfs-for-linux-on-proxmox\/<\/p>\n<p>&nbsp;<\/p>\n<p>First of all, get you system up to date:<\/p>\n<p>apt-get update &amp;&amp; apt-get upgrade -y<\/p>\n<p>Install following utilities\/dependencies to your System:<\/p>\n<p>apt-get -y install autoconf libtool git<br \/>\napt-get -y install build-essential gawk alien fakeroot zlib1g-dev uuid uuid-dev libssl-dev parted pve-headers-$(uname -r)<\/p>\n<p>grab the latest source directory of SPL compile and install the compiled .deb packages:<\/p>\n<p>cd \/opt<br \/>\ngit clone https:\/\/github.com\/zfsonlinux\/spl.git<br \/>\ncd spl<br \/>\n.\/autogen.sh<br \/>\n.\/configure<br \/>\nmake deb<br \/>\ndpkg -i *.deb<\/p>\n<p>check if spl loads correctly by entering:<\/p>\n<p>modprobe spl<\/p>\n<p>now do the same with ZFS source:<\/p>\n<p>cd \/opt<br \/>\ngit clone https:\/\/github.com\/zfsonlinux\/zfs.git<br \/>\ncd zfs<br \/>\n.\/autogen.sh<br \/>\n.\/configure<br \/>\nmake deb<br \/>\ndpkg -i *.deb<\/p>\n<p>check if zfs is working:<\/p>\n<p>modprobe zfs<\/p>\n<p>now add the init script to your system:<\/p>\n<p>update-rc.d zfs defaults<\/p>\n<p>and reboot your system:<\/p>\n<p>reboot<\/p>\n<p>After reboot we are ready to build our Storage Pool:<\/p>\n<p>zpool create -f -o ashift=12 storage mirror \/dev\/sdb \/dev\/sda<\/p>\n<p>And add some tunings:<\/p>\n<p>zfs set compression=on storage<br \/>\nzfs set sync=disabled storage<br \/>\nzfs set primarycache=all storage<br \/>\nzfs set atime=off storage<br \/>\nzfs set checksum=off storage<\/p>\n<p>Important Caution note:<br \/>\nDeduplication feature requires up to 5 GB RAM per Terrabyte Storage Space, so if you cannot afford this amount of exclusive RAM disable dedup by entering:<\/p>\n<p>zfs set dedup=off storage<\/p>\n<p>List your Pool created before:<\/p>\n<p>zpool list storage<\/p>\n<p>NAME SIZE ALLOC FREE CAP DEDUP HEALTH ALTROOT<br \/>\nstorage 1.81T 20.5G 1.79T 1% 1.00x ONLINE &#8211;<\/p>\n<p>If you see something like this above we are Done!<br \/>\nFinally add your newly created Pool \/storage to you Proxmox GUI. When adding new VM\u2019s don\u2019t forget to use RAW disk images and write back for your virtual disks as cache feature to get the huge speedy advantage of your zfs pool.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&#8212; ZFS EATING MEMORY<\/p>\n<p>Todays solution is: If ZFS is eating your memory. In a production usage of ZFS especially when using my native ZFS on Linux article one sympthom that could occur is you ran out of of memory in short time.<\/p>\n<p>Since ZFS is originally designed to run stand alone on a server,<br \/>\nusing its total memory (default arc max value is 80% of total mem) and we are need most of the memory for our KVM instances, we have to cap the memory usage a little bit.<\/p>\n<p>So if you realize high I\/O writes which is eating your memory,<br \/>\nyou can solve this by capping the arc memory limit to a lower value on your host machine.<\/p>\n<p>That is what we are going to do now!<\/p>\n<p>Set zfs_arc_min and zfs_arc_max memory limit<\/p>\n<p>Create a file in \/etc\/modprobe.d\/zfs.conf and add and adjust the zfs_arc_min and zfs_arc_max mem parameters:<\/p>\n<p># Min 2048MB \/ Max 4096 MB Limit<br \/>\noptions zfs zfs_arc_min=2147483648<br \/>\noptions zfs zfs_arc_max=4294967296<\/p>\n<p>Reboot your machine at that should do it.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>original url: http:\/\/ispire.me\/native-zfs-for-linux-on-proxmox\/ &nbsp; First of all, get you system up to date: apt-get update &amp;&amp; apt-get upgrade -y Install following utilities\/dependencies to your System: apt-get -y install autoconf libtool git apt-get -y install build-essential gawk alien fakeroot zlib1g-dev uuid uuid-dev libssl-dev parted pve-headers-$(uname -r) grab the latest source directory of SPL compile and install [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-735","post","type-post","status-publish","format-standard","hentry","category-kategerisiz"],"_links":{"self":[{"href":"https:\/\/www.shukko.com\/x3\/wp-json\/wp\/v2\/posts\/735","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.shukko.com\/x3\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.shukko.com\/x3\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.shukko.com\/x3\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.shukko.com\/x3\/wp-json\/wp\/v2\/comments?post=735"}],"version-history":[{"count":1,"href":"https:\/\/www.shukko.com\/x3\/wp-json\/wp\/v2\/posts\/735\/revisions"}],"predecessor-version":[{"id":736,"href":"https:\/\/www.shukko.com\/x3\/wp-json\/wp\/v2\/posts\/735\/revisions\/736"}],"wp:attachment":[{"href":"https:\/\/www.shukko.com\/x3\/wp-json\/wp\/v2\/media?parent=735"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shukko.com\/x3\/wp-json\/wp\/v2\/categories?post=735"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shukko.com\/x3\/wp-json\/wp\/v2\/tags?post=735"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}