LLM Apps in Production (RAG + Vector DB + Caching) · レッスン

負荷テストとキャパシティプランニング

LLMアプリケーションに現実的なトラフィックをシミュレートし、限界点を見つけ、負荷がかかっても本番環境を高速かつ予算内に保つための容量を計画する方法を学びます。

レッスン 4/413 ステップ

「負荷テストとキャパシティプランニング」はCoddyKit上の無料LLM Apps in Production (RAG + Vector DB + Caching)レッスンです。 これはレッスン4/4です。 下記で完全なレッスンを無料で読むことができます。その後、ブラウザ内の組み込みコードエディタと24時間対応のAIチューターでハンズオン演習できます。 これはLLM Apps in Production (RAG + Vector DB + Caching)学習パスの一部であり、ウェブとCoddyKitアプリ全体で進捗が同期されます。 LLM Apps in Production (RAG + Vector DB + Caching)コースには全4レッスンが含まれています。

このレッスンの一部はまだ翻訳されておらず、英語で表示されています。

Why Load Test LLM Apps?

LLM apps behave differently under load than typical web services: token generation is slow, requests are long-lived, and upstream provider rate limits add a hard ceiling.

Load testing reveals how your system degrades before real users do.

Key Metrics

Track these under load:

  • Throughput — requests or tokens per second
  • Latency percentiles — p50, p95, p99
  • Error rate — timeouts, 429s
  • Time to first token for streaming

Open vs Closed Load Models

Two ways to generate load:

  • Closed — fixed number of virtual users, each waits for a response before sending the next
  • Open — requests arrive at a fixed rate regardless of responses

Open-model tests better expose queue buildup.

Realistic Workloads

Use realistic prompts. A test with tiny prompts hides cost; production prompts include long retrieved context. Sample real queries and vary input length to mimic actual token distributions.

Percentile Latency in Code

Averages lie; percentiles tell the truth about tail latency.

def percentile(values, p):
    s = sorted(values)
    idx = int(round((p/100) * (len(s)-1)))
    return s[idx]

lat = [120, 130, 140, 900, 150]
print('p95 =', percentile(lat, 95))

Finding the Breaking Point

Ramp the request rate gradually until latency or error rate crosses your SLO. That inflection point is your saturation capacity. Run below it in production with headroom.

Estimating Required Capacity

Use Little's Law: concurrency = arrival rate x average latency. Estimate how many concurrent slots you need for peak traffic.

def concurrency(rps, avg_latency_s):
    return rps * avg_latency_s

print('Need', concurrency(50, 2.0), 'concurrent slots')

Accounting for Provider Limits

Your effective capacity may be capped by the LLM provider's tokens-per-minute and requests-per-minute limits, not your servers. Plan around those quotas and request increases ahead of launches.

Headroom and Autoscaling

Run at a target utilization (often 60-70 percent) so spikes do not immediately saturate. Configure autoscaling on a leading signal like queue depth, since CPU is a poor proxy for LLM load.

Soak and Spike Tests

Beyond steady ramps, run:

  • Soak — sustained load for hours to catch leaks
  • Spike — sudden surge to test autoscaling reaction

From Test to Plan

Turn results into a capacity plan: peak rps, required concurrency, provider quota needs, scaling rules, and a cost estimate. Re-test after major changes since model and prompt changes shift the numbers.

Quick Check

Test your understanding of capacity planning.

Recap

You learned to load test LLM apps with realistic workloads, track latency percentiles and error rate, find the saturation point, and size capacity with Little's Law. Account for provider quotas, keep headroom, autoscale on queue depth, and run soak and spike tests.

無料で開始

AI チューターと学ぶ LLM Apps in Production (RAG + Vector DB + Caching) — 無料

ブラウザでリアルコードを書いて実行し、24/7 の AI チューターから瞬時にサポートを受け、ウェブまたはアプリで続きから学習できます。

コース
12
レッスン
48

よくある質問

「負荷テストとキャパシティプランニング」レッスンは無料ですか?

はい。「負荷テストとキャパシティプランニング」の完全なテキストはこのウェブで無料で読めます。インタラクティブに演習し(組み込みコードエディタと24時間対応のAIチューター)、LLM Apps in Production (RAG + Vector DB + Caching)コースの残りをアンロックするには、CoddyKit PROにアップグレードしてください。 LLM Apps in Production (RAG + Vector DB + Caching)コースには全4レッスンが含まれています。

「負荷テストとキャパシティプランニング」で何を学びますか?

LLMアプリケーションに現実的なトラフィックをシミュレートし、限界点を見つけ、負荷がかかっても本番環境を高速かつ予算内に保つための容量を計画する方法を学びます。 ブラウザで直接実行するハンズオンコードでLLM Apps in Production (RAG + Vector DB + Caching)を演習し、24時間対応のAIチューターがレッスンを進める中での質問に答えます。

LLM Apps in Production (RAG + Vector DB + Caching)を始めるのに経験は必要ですか?

事前経験は必要ありません。CoddyKitのLLM Apps in Production (RAG + Vector DB + Caching)は初級者から上級者向けに構成されているため、ここから始めるか最初から始めて、自分のペースで進むことができます。 これはレッスン4/4です。

「負荷テストとキャパシティプランニング」レッスンにはどのくらい時間がかかりますか?

ほとんどのCoddyKitレッスンは約5~10分かかります。各レッスンはコンパクトでインタラクティブなので、着実に進歩し、ウェブとアプリ全体で正確に前回の場所から再開できます。

このLLM Apps in Production (RAG + Vector DB + Caching)レッスンでコードを書いて実行できますか?

はい。すべてのLLM Apps in Production (RAG + Vector DB + Caching)レッスンに組み込みコードエディタが含まれているため、ブラウザでリアルコードを書いて実行し、即座のAIフィードバックを取得できます。ローカル設定は不要です。

このコースのすべてのレッスン

  1. RAGコンポーネントの水平スケーリング
  2. オブザーバビリティ:ログ、メトリクス、トレーシング
  3. LLM運用のアラートとインシデント対応
  4. 負荷テストとキャパシティプランニング
← LLM Apps in Production (RAG + Vector DB + Caching)に戻る