odoo-performance-tuner
Skill này làm gì
Agent này giúp tìm và sửa các vấn đề khiến Odoo chậm. Nó phân tích các truy vấn cơ sở dữ liệu chậm, cài đặt bộ nhớ và các nguyên nhân khác gây chậm chạp.
Khi nào nên dùng
- ✓Khi Odoo mất nhiều thời gian để tải trang.
- ✓Khi bạn gặp lỗi bộ nhớ hoặc timeout trong hệ thống.
- ✓Khi muốn biết truy vấn cơ sở dữ liệu nào đang chạy chậm.
Liên kết skill
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/odoo-performance-tuner/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Odoo của tôi rất chậm, bạn có thể giúp tôi tìm nguyên nhân không?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Bạn mô tả tình trạng chậm và chia sẻ thông tin như thông báo lỗi hoặc cấu hình. Agent phân tích và đề xuất những thay đổi cần thiết để cải thiện hiệu năng.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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
MemoryErrororWorker timeouterrors in logs. - Diagnosing a slow database query using Odoo's profiler.
- Tuning
odoo.conffor a specific server spec.
How It Works
- Activate: Mention
@odoo-performance-tunerand describe your performance issue. - Diagnose: Share relevant log lines or config and receive a root cause analysis.
- 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(), andsorted()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.ormcachedecorator on methods pulled repeatedly with the same arguments. - ❌ Don't: Set
workers = 0in 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_idson 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.confaccess — some tuning options are unavailable.
…
Câu hỏi thường gặp
“Workers” trong Odoo là gì?
Workers là các tiến trình thực hiện tác vụ trong Odoo. Việc điều chỉnh số lượng và giới hạn bộ nhớ của chúng rất quan trọng đối với hiệu năng.
Agent tìm truy vấn chậm bằng cách nào?
Nó có thể dùng các công cụ của Odoo và PostgreSQL để xác định lệnh cơ sở dữ liệu nào chạy lâu hơn dự kiến.
Tôi có thể dùng cái này nếu Odoo của tôi được host trên Odoo.sh không?
Một số cài đặt, như cấu hình PostgreSQL trực tiếp hoặc odoo.conf, có thể không truy cập được trên Odoo.sh.
Chi tiết
Mô tả gốc của tác giả
Expert guide for diagnosing and fixing Odoo performance issues: slow queries, worker configuration, memory limits, PostgreSQL tuning, and profiling tools.
Độ phổ biến
- Sao GitHub
- 48k
- Vị trí xếp hạng
- #5346
- Giấy phép
- MIT
- Cập nhật
- 15/10/2026
Bình luận
- …
Thêm skill từ kho mã này
00-andruia-consultant
48kGiúp agent của bạn bắt đầu hoặc cải thiện các dự án AI. Phân tích mã, gợi ý công cụ và lập kế hoạch hành động bằng tiếng Tây Ban Nha.
007
48kCho phép agent của bạn thực hiện kiểm toán bảo mật và mô hình hóa mối đe dọa. Hữu ích để bảo vệ dự án khỏi các cuộc tấn công và lỗ hổng.
10-andruia-skill-smith
48kGiúp agent của bạn tạo hoặc cải thiện các công cụ AI. Xác định cách công cụ hoạt động, viết tài liệu và kiểm tra cấu trúc.
20-andruia-niche-intelligence
48kGiúp agent của bạn tạo bản tóm tắt về một ngành cụ thể. Hữu ích để hiểu bối cảnh, quy tắc, cách người dùng tương tác và rủi ro của dự án.
Skill tương tự
openclaw-update
394kGiúp agent của bạn cập nhật OpenClaw Gateway đang có, chọn cách cập nhật phù hợp với cách cài đặt và giữ phiên làm việc của bạn hoạt động.
diagnose-gateway
394kGiúp agent của bạn tìm hiểu vì sao OpenClaw Gateway bị lỗi bằng cách kiểm tra cài đặt, kênh và cổng mà không thay đổi gì.
crabbox-apps
394kGiúp agent của bạn mở và chạy một app trên máy đám mây tạm thời, rồi hiển thị giao diện của nó trong thanh bên của chat.