LoginSignup
0
0

More than 5 years have passed since last update.

AzureVMでSWAP設定

Posted at

背景

  • Azure 西日本 A0 インスタンスが別のローションより安い
  • A0の場合、0.75GB RAM 20GBディスクなのでSWAP領域を念のため作成 スクリーンショット 2015-10-30 20.00.24.png

実践

42行目以降を書き換え

/etc/waagent.conf
# TODO: Change n -> y
# Format if unformatted. If 'n', resource disk will not be mounted.
ResourceDisk.Format=y

# TODO: Change n -> y
# Create and use swapfile on resource disk
ResourceDisk.EnableSwap=y

# TODO: Change 1500
# Size of the swapfile.
ResourceDisk.SwapSizeMB=1500

SwapSizeMBは、おおよそ、実搭載メモリ〜2倍が適正だと私は、認識していますので今回は1500MBに設定しました。

sudo reboot

最終確認

リブート後に以下のコマンドでSwapが設定値通りになっていれば成功
free -h

TODO: dfなども同様に-hオプションをつけると可視性がアップします。

西日本A0インスタンスについて

正直なところ、西日本で安いのでテスト用途向けかなと感じています。
レスポンスタイムはやはり早いので、その分、テスト用途ではカバーできていますが…

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