Oracle Cloud Cleaning Up Idle Compute Instances & How to Keep it

Recently some Oracle Cloud Free Tier users received a email regarding their compute instances identified as idle. And the those identified idle instances will be stopped in one week. Also Orcle Cloud Infrastructure (OCI) suggested to convert the account to Pay As You Go (PAYG) to avoid stopping. 

Here is the email content from Reddit

Oracle Cloud Infrastructure Customer,

Oracle Cloud Infrastructure (OCI) will be reclaiming idle Always Free compute resources from Always Free customers. Reclaiming idle resources allows OCI to efficiently provide services to Always Free customers. Your account has been identified as having one or more compute instances that have been idle for the past 7 days. These idle instances will be stopped one week from today, January 30,2023. If your idle Always Free compute instance is stopped, you can restart it as long as the associated compute shape is available in your region. You can keep idle compute instances from being stopped by converting your account to Pay As You Go (PAYG). With PAYG, you will not be charged as long as your usage for all OCI resources remains within the Always Free limits.

History

Nov 15 2022, a new announcement regarding idle resources might subject stopping were added into OCI website. 

从 2022 年 11 月 24 日开始,您闲置的 Always Free 计算实例可能会停止。 详细了解此过程以及如何重启您的实例。 您还可以随时升级您的帐户以避免中断。

仅限未付费的免费套餐帐户。Idle Always未付费免费套餐帐户的免费资源可以随时回收,恕不另行通知。回收包括停止或终止等操作。

Nov 19 2022, this announcement disappeared

Idle Compute Instances

 Important

Reclamation of Idle Compute Instances

Idle Always Free compute instances may be reclaimed by Oracle. Oracle will deem virtual machine and bare metal compute instances as idle if, during a 7-day period, the following are true:

  • CPU utilization for the 95th percentile is less than 10%
  • Network utilization is less than 10%
  • Memory utilization is less than 10% (applies to A1 shapes only)
Based on what I am reading, it will need all those conditions met to make your free tier instances subject to be stopped. Unfortunately, there are no more details or explaination coming out. Strongly suggest free tier users to upgrade to Pay As You Go plan since all free tier resources will not be charged after you upgraded, but your idle resources will not subject to this stopping. 
Unfortunately not all free users will be able to upgrade to PAYG easily. You might get following error messages
"We're unable to complete your request. Common errors are due to: (a) Using prepaid cards. Oracle only accepts credit card and debit cards (b) Intentionally or unintentionally masking one's location or identity (c) Entering incomplete or inaccurate account details. Please try again if this applies to you. Otherwise, contact Oracle Customer Service."

If that is a case, here are some methods found online which might help to keep your idle computing resources in Oracle Cloud. But there is no guarantee those will work. I will keep an eye on the Internet regarding how effective they are. 

NeverIdle Github Project Method to Keep it

 

NeverIdle - Github project: https://github.com/layou233/NeverIdle
Steps:

1 install dependencies

You might need to install wget and screen those two applications:

Based on your OS ,  this is command

  • yum install -y wget screen
  • apt install -y wget screen

2 Download script

# AMD Server

  • wget https://github.com/layou233/NeverIdle/releases/download/0.1/NeverIdle-linux-amd64 -O NeverIdle

# ARM Server

  • wget https://github.com/layou233/NeverIdle/releases/download/0.1/NeverIdle-linux-arm64 -O NeverIdle

3 Change file permission

  • chmod 777 NeverIdle

4 Run Command

  • screen -R baohuo
Command Explaination:

./NeverIdle -c 2h1m2s -m 2 -n 4h

-c : for cpu consumption. every 2 hour 1 minute 2 second (format is 2h1m2s), it will waste CPU once

-m : enable memory occupation. 2 means 2GB

-n : execute once to waste network for Ookla Speed Test. It will show the output on your screen.

5 Detaching and Reattaching screen session

To detach from screen and leave the window running in the background, use the keystroke:

Detach: Ctrl + a + d

Reattach: screen -r

Other screen commands:

  • Ctrl + a and c – Open a new screen window.
  • Ctrl + a and " – List all open windows.
  • Ctrl + a and 0 – Switch to window 0 (or any other numbered window).
  • Ctrl + a and A – Rename the current window.
  • Ctrl + a and S - Split the screen horizontally, with the current window on top.
  • Ctrl + a and | - Split the screen vertically, with the current window on the left.
  • Ctrl + a and tab – Switch focus between areas of the split screen.
  • Ctrl + a and Ctrl + a – Switch between current and previous windows.
  • Ctrl + a and n – Switch to the next window.
  • Ctrl + a and p – Switch to the previous window.
  • Ctrl + a and Q – Quit all other windows except the current one..
  • Ctrl + a and X – Lock the current window.
  • Ctrl + a and H – Create a running log of the session.
  • Ctrl + a and M – Monitor a window for output (a notification pops up when that window has activity).
  • Ctrl + a and _ - Watch a window for absence of output (such as when a file finishes downloading or a compiler finishes).

Other Methods to Keep Your Idle Resources

 

Shell Scripts

  • curl https://keeporacle.pages.dev/ -o keeporacle.sh && chmod +x keeporacle.sh && ./keeporacle.sh
  • or
  • wget https://keeporacle.pages.dev/ -O keeporacle.sh && chmod +x keeporacle.sh && ./keeporacle.sh

Source:https://hostloc.com/thread-1131732-1-1.html

lookbusy

  • lookbusy -c 50 # 占用所有 CPU 核心各 50%
  • lookbusy -c 50 -n 2 # 占用两个 CPU 核心各 50%
  • lookbusy -c 50-80 -r curve # 占用所有 CPU 核心在 50%-80% 左右浮动
  • lookbusy -c 0 -m 128MB -M 1000 # 每 1000 毫秒,循环释放并分配 128MB 内存
  • lookbusy -c 0 -d 1GB -b 1MB -D 10 # 每 10 毫秒,循环进行 1MB 磁盘写入,临时文件不超过 1GB

 

Calculate Pi

  • nohup echo "scale=99999999;4*a(1)" | bc -lq > /dev/null &
  • nohup cpulimit -l 30 -p 22489 >/dev/null &

  • scale那个代表小数点后的位数,数越大计算时间越长
  • -l 那里可以控制cpu使用率0-200
  • -p 那里写程序的PID,通过top命令查找,或者 ps -aux | grep bc

Source:https://hostloc.com/thread-1131769-1-1.html

版权声明:
作者:ht
链接:https://www.techfm.club/p/39609.html
来源:TechFM
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
< <上一篇
下一篇>>