jpskill.com
🛠️ 開発・MCP コミュニティ 🔴 エンジニア向け 👤 エンジニア・AI開発者

🛠️ Odoo Performance Tuner

odoo-performance-tuner

Odooの動作が遅い、処理に時間が

⏱ コードレビュー 1時間 → 10分

📺 まず動画で見る(YouTube)

▶ 【衝撃】最強のAIエージェント「Claude Code」の最新機能・使い方・プログラミングをAIで効率化する超実践術を解説! ↗

※ jpskill.com 編集部が参考用に選んだ動画です。動画の内容と Skill の挙動は厳密には一致しないことがあります。

📜 元の英語説明(参考)

Expert guide for diagnosing and fixing Odoo performance issues: slow queries, worker configuration, memory limits, PostgreSQL tuning, and profiling tools.

🇯🇵 日本人クリエイター向け解説

一言でいうと

Odooの動作が遅い、処理に時間が

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o odoo-performance-tuner.zip https://jpskill.com/download/3242.zip && unzip -o odoo-performance-tuner.zip && rm odoo-performance-tuner.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/3242.zip -OutFile "$d\odoo-performance-tuner.zip"; Expand-Archive "$d\odoo-performance-tuner.zip" -DestinationPath $d -Force; ri "$d\odoo-performance-tuner.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して odoo-performance-tuner.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → odoo-performance-tuner フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-17
取得日時
2026-05-17
同梱ファイル
1

💬 こう話しかけるだけ — サンプルプロンプト

  • Odoo Performance Tuner を使って、最小構成のサンプルコードを示して
  • Odoo Performance Tuner の主な使い方と注意点を教えて
  • Odoo Performance Tuner を既存プロジェクトに組み込む方法を教えて

これをClaude Code に貼るだけで、このSkillが自動発動します。

📖 Claude が読む原文 SKILL.md(中身を展開)

この本文は AI(Claude)が読むための原文(英語または中国語)です。日本語訳は順次追加中。

Odoo Performance Tuner

Overview

This skill helps diagnose and resolve Odoo performance problems — from slow page loads and database bottlenecks to worker misconfiguration and memory bloat. It covers PostgreSQL query tuning, Odoo worker settings, and built-in profiling tools.

When to Use This Skill

  • Odoo is slow in production (slow page loads, timeouts).
  • Getting MemoryError or Worker timeout errors in logs.
  • Diagnosing a slow database query using Odoo's profiler.
  • Tuning odoo.conf for a specific server spec.

How It Works

  1. Activate: Mention @odoo-performance-tuner and describe your performance issue.
  2. Diagnose: Share relevant log lines or config and receive a root cause analysis.
  3. Fix: Get exact configuration changes with explanations.

Examples

Example 1: Recommended Worker Configuration

# odoo.conf — tuned for a 4-core, 8GB RAM server

workers = 9                   # (CPU_cores × 2) + 1 — never set to 0 in production
max_cron_threads = 2          # background cron jobs; keep ≤ 2 to preserve user-facing capacity
limit_memory_soft = 1610612736  # 1.5 GB — worker is recycled gracefully after this
limit_memory_hard = 2147483648  # 2.0 GB — worker is killed immediately; prevents OOM crashes
limit_time_cpu = 600          # max CPU seconds per request
limit_time_real = 1200        # max wall-clock seconds per request
limit_request = 8192          # max requests before worker recycles (prevents memory leaks)

Example 2: Find Slow Queries with PostgreSQL

-- Step 1: Enable pg_stat_statements extension (run once as postgres superuser)
CREATE EXTENSION IF NOT EXISTS pg_stat_statements;

-- Step 2: Also add to postgresql.conf and reload:
-- shared_preload_libraries = 'pg_stat_statements'
-- log_min_duration_statement = 1000   -- log queries taking > 1 second

-- Step 3: Find the top 10 slowest average queries
SELECT
    LEFT(query, 100) AS query_snippet,
    round(mean_exec_time::numeric, 2) AS avg_ms,
    calls,
    round(total_exec_time::numeric, 2) AS total_ms
FROM pg_stat_statements
ORDER BY mean_exec_time DESC
LIMIT 10;

-- Step 4: Check for missing indexes causing full table scans
SELECT schemaname, tablename, attname, n_distinct, correlation
FROM pg_stats
WHERE tablename = 'sale_order_line'
  AND correlation < 0.5   -- low correlation = poor index efficiency
ORDER BY n_distinct DESC;

Example 3: Use Odoo's Built-In Profiler

Prerequisites: Run Odoo with ?debug=1 in the URL to enable debug mode.

Menu: Settings → Technical → Profiling

Steps:
  1. Click "Enable Profiling" — set a duration (e.g., 60 seconds)
  2. Navigate to and reproduce the slow action
  3. Return to Settings → Technical → Profiling → View Results

What to look for:
  - Total SQL queries > 100 on a single page  → N+1 query problem
  - Single queries taking > 100ms             → missing DB index
  - Same query repeated many times            → missing cache, use @ormcache
  - Python time high but SQL low             → compute field inefficiency

Best Practices

  • Do: Use mapped(), filtered(), and sorted() on in-memory recordsets — they don't trigger additional SQL.
  • Do: Add PostgreSQL B-tree indexes on columns frequently used in domain filters (partner_id, state, date_order).
  • Do: Enable Odoo's HTTP caching for static assets and put a CDN (Cloudflare, AWS CloudFront) in front of the website.
  • Do: Use @tools.ormcache decorator on methods pulled repeatedly with the same arguments.
  • Don't: Set workers = 0 in production — single-threaded mode serializes all requests and blocks all users on any slow operation.
  • Don't: Ignore limit_memory_soft — workers exceeding it are recycled between requests; without the limit they grow unbounded and crash.
  • Don't: Directly manipulate prefetch_ids on recordsets — rely on Odoo's automatic batch prefetching, which activates by default.

Limitations

  • PostgreSQL tuning (shared_buffers, work_mem, effective_cache_size) is highly server-specific and not covered in depth here — use PGTune as a starting baseline.
  • The built-in Odoo profiler only captures Python + SQL traces; JavaScript rendering performance requires browser DevTools.
  • Odoo.sh managed hosting restricts direct PostgreSQL and odoo.conf access — some tuning options are unavailable.
  • Does not cover Redis-based session store or Celery task queue optimizations, which are advanced patterns for very high-traffic instances.