Langsung ke konten
Skillpedia
Deploy & cloud (DevOps)48k ยท #5346

odoo-performance-tuner

Fungsinya

Agen ini membantu menemukan dan memperbaiki masalah yang membuat Odoo lambat. Agen ini menganalisis query database yang lambat, pengaturan memori, dan penyebab lain dari performa yang buruk.

Kapan dipakai

  • โœ“Saat Odoo membutuhkan waktu lama untuk memuat halaman.
  • โœ“Saat Anda mengalami error memori atau timeout di sistem.
  • โœ“Untuk memahami query database mana yang berjalan lambat.

Link skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/odoo-performance-tuner/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/odoo-performance-tuner/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit โ†’

Contoh permintaan ke AI

โ€œOdoo saya sangat lambat, bisakah Anda bantu mencari tahu penyebabnya?โ€

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Anda menjelaskan masalah kelambatan dan membagikan informasi seperti pesan error atau konfigurasi. Agen ini menganalisisnya dan menyarankan perubahan yang diperlukan untuk meningkatkan performa.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

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.

โ€ฆ

Pertanyaan umum

Apa itu 'worker' di Odoo?

Worker adalah proses yang menjalankan tugas di Odoo. Mengatur jumlah dan batas memorinya sangat penting untuk performa.

Bagaimana agen ini menemukan query yang lambat?

Agen ini dapat menggunakan alat bawaan Odoo dan PostgreSQL untuk mengidentifikasi perintah database yang berjalan lebih lama dari yang seharusnya.

Bisakah saya menggunakan ini jika Odoo saya di-hosting di Odoo.sh?

Beberapa pengaturan, seperti akses langsung ke PostgreSQL atau konfigurasi odoo.conf, mungkin tidak dapat diakses di Odoo.sh.

Detail

Deskripsi asli dari pembuat

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

repo: sickn33/agentic-awesome-skills

Popularitas

Bintang GitHub
48k
Peringkat
#5346
Lisensi
MIT
Diperbarui
15/10/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • โ€ฆ

Skill lain dari repositori ini

Skill serupa