0
0

More than 5 years have passed since last update.

俺様サーバー構築記 - ZFS のcacheを切る →激重!@ノートパソコン2台目(BIOS)

Posted at

俺様サーバー構築記 - 基本方針」に基づいて自宅サーバーの構築を進め、古いノートパソコン2台もArchLinuxで再生しました

しかしこの2台目の方は、とにかくスペックがしょぼい。それでもサクサク動いてしまう辺りはさすが ArchLinux + Xfce です。しかしメモリのしょぼさはいかんともし難く、chromiumブラウザで広告バリバリのWebサイトを2タブくらい開くと、もうHDDガリガリガリガリで使い物になりません。

そこで少しでも改善するべく、zvolのキャッシュをoffにしてみます。

参考文献1: 6.9 スワップボリューム - 6 使用方法 - ZFS - ArchWiki

この参考文献には下記の記述がありました。

メモリが少ないシチュエーションでシステムを上手く動作させ続けるには zvol データのキャッシュを行わないほうが良いでしょう。

参考文献2: ZFS の READ 用キャッシュチューニング方法 - やっぱり Sun がスキ!

この記事に基づいて、下記のように操作してみます。

現在の設定

zfs get コマンドはスーパーユーザー(root)でなくても実行できるようです。

$ zfs get all | grep cache
tank                    primarycache          all                    default
tank                    secondarycache        all                    default
tank@before_Xfce        primarycache          all                    default
tank@before_Xfce        secondarycache        all                    default
tank@before_nkf         primarycache          all                    default
tank@before_nkf         secondarycache        all                    default
tank@before_ArchSystem  primarycache          all                    default
tank@before_ArchSystem  secondarycache        all                    default
tank/oldversion         primarycache          all                    default
tank/oldversion         secondarycache        all                    default

見事に全部 all でした。

readキャッシュoff

設定変更はスーパーユーザー(root)でなければならない模様。

$ su
パスワード:
# zfs set primarycache=none tank
# zfs set secondarycache=none tank

変更を確認します。

# zfs get all | grep cache
tank                    primarycache          none                   local
tank                    secondarycache        none                   local
tank@before_Xfce        primarycache          none                   inherited from tank
tank@before_Xfce        secondarycache        none                   inherited from tank
tank@before_nkf         primarycache          none                   inherited from tank
tank@before_nkf         secondarycache        none                   inherited from tank
tank@before_ArchSystem  primarycache          none                   inherited from tank
tank@before_ArchSystem  secondarycache        none                   inherited from tank
tank/oldversion         primarycache          none                   inherited from tank
tank/oldversion         secondarycache        none                   inherited from tank

あれ、tankだけ変えたら、そのスナップショットとクローンが全部一斉に変わりました。まあいいんですが。"inherited from tank" って表示されるので、恐らくそういう事なのでしょう。

確認、そして…

このままマシンを再起動。

…だめですね。体感速度で、明らかに起動が遅くなっています。ログインも遅い。ブラウザも、起動するだけで「このページは反応していません」メッセージが表示されるほど遅い。激重です。使い物になりません。

キャッシュの値は all と none と、もう一つ metadata があるとの事なのでそれも試してみましたが。多少マシになりましたけど、使い物にならないほど激重という評価は変わりませんね。

という訳で。諦めて all に戻しました。そういう事もあります…:sob:

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0