[pve-devel] [PATCH installer] fix #1239: enhance swap on ZFS setup

Andreas Steinel a.steinel at gmail.com
Wed Jan 25 23:07:37 CET 2017


Good! I presume you did not implement the variable page block size due to
the "controlled kernel" you provide which always has default 4K pages on
x64?

On Wed, Jan 25, 2017 at 4:03 PM, Fabian Grünbichler <
f.gruenbichler at proxmox.com> wrote:

> set properties according to upstream documentation
>
> Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
> ---
>  proxinstall | 25 ++++++++++++++++---------
>  1 file changed, 16 insertions(+), 9 deletions(-)
>
> diff --git a/proxinstall b/proxinstall
> index 18df7bb..0642098 100755
> --- a/proxinstall
> +++ b/proxinstall
> @@ -762,19 +762,26 @@ sub zfs_create_rpool {
>  sub zfs_create_swap {
>      my ($swapsize) = @_;
>
> -    syscmd ("zfs create -V ${swapsize}K -b 4K $zfspoolname/swap")  == 0 ||
> -       die "unable to create zfs swap device\n";
> +    my $cmd = "zfs create -V ${swapsize}K -b 4K";
>
> -    syscmd ("zfs set com.sun:auto-snapshot=false $zfspoolname/swap") == 0
> ||
> -       die "unable to set zfs properties\n";
> +    $cmd .= " -o com.sun:auto-snapshot=false";
>
>      # reduces memory pressure
> -    syscmd ("zfs set sync=always $zfspoolname/swap") == 0 ||
> -       die "unable to set zfs properties\n";
> +    $cmd .= " -o sync=always";
>
> -    # copies for swap does not make sense
> -    syscmd ("zfs set copies=1 $zfspoolname/swap") == 0 ||
> -       die "unable to set zfs properties\n";
> +    # cheapest compression to drop zero pages
> +    $cmd .= " -o compression=zle";
> +
> +    # skip log devices
> +    $cmd .= " -o logbias=throughput";
> +    # only cache metadata in RAM (caching swap content does not make
> sense)
> +    $cmd .= " -o primarycache=metadata";
> +    # don't cache anything in L2ARC
> +    $cmd .= " -o secondarycache=none";
> +
> +    $cmd .= " $zfspoolname/swap";
> +    syscmd ($cmd)  == 0 ||
> +       die "unable to create zfs swap device\n";
>
>      return "/dev/zvol/$zfspoolname/swap";
>  }
> --
> 2.1.4
>
>
> _______________________________________________
> pve-devel mailing list
> pve-devel at pve.proxmox.com
> http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
>



More information about the pve-devel mailing list