Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
20240414_cloudgirl_ec2_costdown
Search
snowwhite
April 14, 2024
190
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
20240414_cloudgirl_ec2_costdown
2024年4月14日に行われたJAWS-UGクラウド女子会で登壇した資料です。
snowwhite
April 14, 2024
Transcript
16 slides
EC2のコストを考える 2024/04/14 株式会社ゆめみ 白"雪姫"
自己紹介 Name: 白”雪姫”(Shirayuki) Profile: 2023年8月、ゆめみ入社 ネットワークをメインにH/Wサーバの保守などを経験、その後、セキュリティの世界で物理や 専用クラウドを中心にインフラを経験、最近は AWSを多少触り始める。 苗字を呼ばれるのが嫌いなので、名前 orX名で読んでいただくことが多い
Liked Service: AWS Inspecter X(旧Twitter): @yuri_snowwhite
開発用のEC2って意外に高いと 感じませんか?
1ヶ月(30日仮定) で起動してみる サンプルにしたスペック 東京リージョン t3.micro gp2の30GiB EBS EIP無し AmazonLinux オンデマンド稼働
稼働料金 0.0136 $/hr x 24 h x 30 days EBS料金 0.12 x 30GiB 合計 13.392$(約2008.8円)
使っていない時間は 止めたら良いのでは?
平日夜間帯や土日を停止した場合の料 金を算出
1ヶ月(30日仮定) で起動してみる サンプルにしたスペック 東京リージョン t3.micro gp2の30GiB EBS EIP無し AmazonLinux オンデマンド稼働
起動時間はAM5:00〜PM22:00の 17時間・土日は停止(8日換算) 24hの時は稼働料金は 13.392$(約2008.8円) 稼働料金 0.0136 $/hr x 17 h x 22days EBS料金 0.12 x 30GiB 合計 8.6864$(1580.4円) 差額 4.7056$(705.84円)/月
金額の増加率 グラフも比例的に差分 幅が広がっていく
どうやって時間停止する?
利用したサービス ・稼働しているEC2 ・Amazon EventBridge ・EventBridgeで起動するスクリプト(マネージメントコンソールで選択できる) 起動・停止を実行 時間記載はcron方式
実践-1 Amazon EventBridgeのスケジュールから新規作成。 cron方式を選択して、月曜〜金曜の設定。 この際、Start用とStop用で2スケジュール必要なので注意。 また、時間設定は以下を参考に設定 https://docs.aws.amazon.com/ja_jp/eventbridge/latest/userguide/e b-cron-expressions.html
実践-2 ターゲットAPIのところで「すべての API」でEC2を選択、起動時は「Start」 (停止の時は「Stop」)で検索をすると 該当のスクリプトが出てきます。
実践-3 実践2のスライドで選択すると自動的 にスライドしていき、下記の画面に移 動します。 この"MyData”をインスタンスIDへ書き 換えて完了です。 複数台ある場合は、「,」区切りにて指 定も可能です。 残りはウィザードに従います。
メリットとデメリット メリット ・手軽にコストの削減が出来る ・手動で実行する手間は省ける ・複数台居ても設定をしっかりしていれ ば、停止, 起動漏れはおきない ・起動または停止を変更したいときは AWS EventBridgeで無効化すれば実行
されない様に出来る デメリット ・開発過渡期などの長時間起動が必要 な時には使えない ・パブリックIPを紐付ける設定の場合は 毎回IPが変わってしまう
実際やってみて 4.7056$/month x 12 mon = 56.4672 $ 約8470円 を削減しました。
ご静聴ありがとうございました Fin.
More Decks by snowwhite
See All by snowwhite
20260804_NW-JAWS
yuri_snowwhite
1
740
20250625_anthoropic_booth_mini_session
yuri_snowwhite
0
78
20260527_IAM_IdentityCenter_is_a_IIC_management
yuri_snowwhite
0
74
20260521_security_any_AI_is_ray_trusted_loved
yuri_snowwhite
0
130
AWS Global Community Gatherings # 16
yuri_snowwhite
1
77
20251108_SecJAWS_IAMSp
yuri_snowwhite
0
96
20250730_AWS_AmazonQ
yuri_snowwhite
1
130
20250601_storage_and_bigdate_JAWS
yuri_snowwhite
1
100
250226_SecurityJAWS
yuri_snowwhite
2
1.3k
Featured
See All Featured
VelocityConf: Rendering Performance Case Studies
addyosmani
331
25k
The agentic SEO stack - context over prompts
schlessera
0
1k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
23k
So, you think you're a good person
axbom
PRO
2
2.3k
What the history of the web can teach us about the future of AI
inesmontani
PRO
3
810
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.9k
Fireside Chat
paigeccino
43
4.1k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.6k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
640
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.8k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.9k
Designing for humans not robots
tammielis
254
26k