2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Oracle CloudのAlways Free マイクロ・インスタンスを有効に活用する方法

Posted at

はじめに

Oracle CloudのFree Tierには「Always Freeクラウド・サービス」と「30日間無料トライアル」の二つの無料プログラムがあり、両方同時に利用することが可能です。そして、Always Freeクラウド・サービスは期間の定めなく無料で利用することが可能というお得なサービスとなっています。
Always Freeクラウド・サービスの一覧は Oracle CloudのFree Tier を確認すると以下のようなサービスがあります。

image.png

今回はこのサービスの中の赤枠「2つのAMDベースのCompute VM、それぞれに1/8 OCPU**と1GBのメモリ」をほんのちょっとだけお得に?利用する方法をシェアします。

Free TierのCompute VMの状況

Free TierのCompute VMには1GBのメモリが割り当てられているはずですが、実際に確認すると以下のように680MBのメモリしか割り当てられておらず、1GBのメモリが利用できていません。

メモリの状況
$ free -m
              total        used        free      shared  buff/cache   available
Mem:            680         192         237           1         250         384
Swap:          1360         348        1012

dmesgを確認すると、以下の通り、crashkernelとして280MBが割り当てられてしまっていることが確認できます。

dmesg
[    0.008900] Using crashkernel=auto, the size chosen is a best effort estimation.
[    0.008903] Reserving 280MB of memory at 678MB for crashkernel (System RAM: 1018MB)

Productionの環境で利用する場合には、kdumpの機能は必要な場合もありますが、基本的にAlways Freeで利用するような状況の場合には、不要と考えてます。以下でkdumpを無効化します。

kdump無効化
$ sudo systemctl disable --now kdump.service
Removed /etc/systemd/system/multi-user.target.wants/kdump.service.
$ sudo vim /etc/default/grub
## crashkernel=auto → crashkernel=no
$ sudo grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
Adding boot menu entry for EFI firmware configuration
done
## インスタンス再起動

kdump無効化後のメモリ割り当て状況は以下のようになり、960MBのメモリが利用できるようになりました。

メモリ割り当て状況
$  free -m
              total        used        free      shared  buff/cache   available
Mem:            960         518          21           1         420         412
Swap:          1360           6        1354

まとめ

Always Freeのリソースは無料で利用できるため、必要に応じて今回紹介した方法等を活用し、少しでも有効にリソースを利用していければと考えてます。
(特にAlways Freeのマイクロ・インスタンスに限定した話ではありませんが、Always Freeのマイクロ・インスタンスなら今回のような活用をしやすいと思い、このような形で紹介しました)

2
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
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?