> For the complete documentation index, see [llms.txt](https://developer.mixeder.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.mixeder.net/api-reference/ysuksu.md).

# ユースケース

停止中は 「CPUとメモリの料金は止まるが、ディスク（ストレージ）料金は場所を確保しているため発生し続ける」 という、一般的なVPSの仕様に合わせたシミュレーションを作成しました。

この条件では、「いかにVPSのディスクサイズを小さく保つか」 が節約の最大の鍵となります。（VPSディスク単価はS3の200倍高いため）

***

#### 💡 料金計算の前提（1ヶ月 = 30日 = 43,200分）

比較しやすいように、1MBあたりの月額単価を算出しておきます。

* VPSディスク (確保分): 0.864 Credits / 1MB / 月 (停止中も発生)
* メモリ (稼働分): 4.32 Credits / 1MB / 月 (稼働時のみ)
* S3ストレージ: 0.0043 Credits / 1MB / 月 (常に発生)

***

#### 🎮 ケース1：週末限定のマインクラフトサーバー

「ハイスペックだが稼働時間は短い」 パターンです。

停止中もディスク料金がかかるため、ワールドデータ以外の不要なファイルは置かないのがコツです。

構成条件:

* 稼働時間: 週末のみ月20時間 (1,200分)
* VPSスペック:
  * メモリ: 2 GB (2,048 MB) - 起動時のみ課金
  * CPU: 平均 30% - 起動時のみ課金
  * ディスク: 1 GB (1,024 MB) - 常時課金
* バックアップ (S3):
  * 過去のワールドデータ: 5 GB

💰 月額コスト内訳

| **項目**        | **状態**    | **計算式**                                      | **コスト (Credits)** |
| ------------- | --------- | -------------------------------------------- | ----------------- |
| メモリ (2GB)     | 稼働 (20時間) | $$ $2,048 \times 0.0001 \times 1,200$ $$     | 245.76            |
| CPU (30%)     | 稼働 (20時間) | $$ $30 \times 0.0002 \times 1,200$ $$        | 7.20              |
| VPSディスク (1GB) | 常時 (1ヶ月)  | $$ $1,024 \times 0.00002 \times 43,200$ $$   | 884.74            |
| S3保存 (5GB)    | 常時 (1ヶ月)  | $$ $5,120 \times 0.0000001 \times 43,200$ $$ | 22.12             |
| 合計            |           |                                              | 約 1,160 Credits   |

> 分析: 稼働時間が短くても、VPSのディスク（1GB）を確保し続けているため、コストの 約75%がディスク代 になります。遊ばない期間が長いなら、S3にデータを退避してVPS自体を削除すれば、月額30クレジット以下に抑えられます。

***

#### 🤖 ケース2：常時稼働のDiscord Bot / APIサーバー

「ロースペックで24時間365日動かす」 パターンです。

メモリとディスクを極限まで削る構成です。

構成条件:

* 稼働時間: 24時間フル稼働 (43,200分)
* VPSスペック:
  * メモリ: 128 MB
  * CPU: 平均 2%
  * ディスク: 200 MB (コードと最小限のログのみ)
* S3ストレージ: なし

💰 月額コスト内訳

| **項目**          | **状態** | **計算式**                                  | **コスト (Credits)** |
| --------------- | ------ | ---------------------------------------- | ----------------- |
| メモリ (128MB)     | 常時     | $$ $128 \times 0.0001 \times 43,200$ $$  | 552.96            |
| CPU (2%)        | 常時     | $$ $2 \times 0.0002 \times 43,200$ $$    | 17.28             |
| VPSディスク (200MB) | 常時     | $$ $200 \times 0.00002 \times 43,200$ $$ | 172.80            |
| 合計              |        |                                          | 約 743 Credits     |

> 分析: ディスクを200MBまで節約したことで、初期クレジット(1000)の範囲内で1ヶ月以上の連続稼働が可能です。もしディスクを1GB確保してしまうと、それだけで+884クレジットかかり、赤字になります。

***

#### 🌐 ケース3：画像投稿サイト（Webアプリ + S3）

「VPSのディスクはコードだけ。データは全てS3」 という最も効率的な構成です。

VPSディスクを「プログラム実行用の一時領域」と割り切ることで、停止中のコストも最小化します。

構成条件:

* 稼働時間: 日中のみ稼働（1日12時間 = 月21,600分）
* VPSスペック:
  * メモリ: 512 MB
  * CPU: 平均 5%
  * ディスク: 100 MB (アプリ本体のみ。ログはS3へ転送して即削除)
* S3ストレージ:
  * ユーザー画像データ: 10 GB (10,240 MB)
  * 月間リクエスト: 20,000回

💰 月額コスト内訳

| **項目**          | **状態** | **計算式**                                       | **コスト (Credits)** |
| --------------- | ------ | --------------------------------------------- | ----------------- |
| メモリ (512MB)     | 半日稼働   | $$ $512 \times 0.0001 \times 21,600$ $$       | 1,105.92          |
| CPU (5%)        | 半日稼働   | $$ $5 \times 0.0002 \times 21,600$ $$         | 21.60             |
| VPSディスク (100MB) | 常時     | $$ $100 \times 0.00002 \times 43,200$ $$      | 86.40             |
| S3保存 (10GB)     | 常時     | $$ $10,240 \times 0.0000001 \times 43,200$ $$ | 44.24             |
| S3リクエスト         | -      | $$ $20,000 \times 0.001$ $$                   | 20.00             |
| 合計              |        |                                               | 約 1,278 Credits   |

> 分析: 10GBものデータを扱っているにも関わらず、それをS3に逃がしているためストレージコストは非常に低く抑えられています。もし10GBをVPSディスクに置いていたら、ディスク代だけで約8,800クレジット かかってしまいます。

***

#### 🛡️ 結論：この料金体系での「賢い使い方」

停止中もディスク料金がかかる場合、以下の3点が重要になります。

1. VPSのディスクは「最小限」にする
   * ログファイル、バックアップ、アップロードされた画像などは、VPS内に溜め込まず、すぐにS3へ転送してVPSからは削除しましょう。
   * VPSディスク単価(0.864)は、S3単価(0.0043)の 約200倍 です。
2. 長期停止するなら「削除」
   * 「1ヶ月使わない」という場合、停止(Stop)しておくだけではディスク代がかかり続けます。
   * 重要なデータだけS3に退避し、VPS自体を削除(Delete)すれば、維持費はS3代（数十クレジット）だけで済みます。
3. Docker等のイメージサイズに注意
   * 大きなライブラリを含む環境（1GB以上など）を作ると、それだけで毎月1,000クレジット近く消費します。Alpine Linuxベースなどの軽量な環境を使うのがおすすめです。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developer.mixeder.net/api-reference/ysuksu.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
