{"id":"6bee6b7d-2ce3-4ab8-932e-20c906d76234","shortId":"L7AJpg","kind":"skill","title":"odoo-performance-tuner","tagline":"Expert guide for diagnosing and fixing Odoo performance issues: slow queries, worker configuration, memory limits, PostgreSQL tuning, and profiling tools.","description":"# Odoo Performance Tuner\n\n## Overview\n\nThis 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.\n\n## When to Use This Skill\n\n- Odoo is slow in production (slow page loads, timeouts).\n- Getting `MemoryError` or `Worker timeout` errors in logs.\n- Diagnosing a slow database query using Odoo's profiler.\n- Tuning `odoo.conf` for a specific server spec.\n\n## How It Works\n\n1. **Activate**: Mention `@odoo-performance-tuner` and describe your performance issue.\n2. **Diagnose**: Share relevant log lines or config and receive a root cause analysis.\n3. **Fix**: Get exact configuration changes with explanations.\n\n## Examples\n\n### Example 1: Recommended Worker Configuration\n\n```ini\n# odoo.conf — tuned for a 4-core, 8GB RAM server\n\nworkers = 9                   # (CPU_cores × 2) + 1 — never set to 0 in production\nmax_cron_threads = 2          # background cron jobs; keep ≤ 2 to preserve user-facing capacity\nlimit_memory_soft = 1610612736  # 1.5 GB — worker is recycled gracefully after this\nlimit_memory_hard = 2147483648  # 2.0 GB — worker is killed immediately; prevents OOM crashes\nlimit_time_cpu = 600          # max CPU seconds per request\nlimit_time_real = 1200        # max wall-clock seconds per request\nlimit_request = 8192          # max requests before worker recycles (prevents memory leaks)\n```\n\n### Example 2: Find Slow Queries with PostgreSQL\n\n```sql\n-- Step 1: Enable pg_stat_statements extension (run once as postgres superuser)\nCREATE EXTENSION IF NOT EXISTS pg_stat_statements;\n\n-- Step 2: Also add to postgresql.conf and reload:\n-- shared_preload_libraries = 'pg_stat_statements'\n-- log_min_duration_statement = 1000   -- log queries taking > 1 second\n\n-- Step 3: Find the top 10 slowest average queries\nSELECT\n    LEFT(query, 100) AS query_snippet,\n    round(mean_exec_time::numeric, 2) AS avg_ms,\n    calls,\n    round(total_exec_time::numeric, 2) AS total_ms\nFROM pg_stat_statements\nORDER BY mean_exec_time DESC\nLIMIT 10;\n\n-- Step 4: Check for missing indexes causing full table scans\nSELECT schemaname, tablename, attname, n_distinct, correlation\nFROM pg_stats\nWHERE tablename = 'sale_order_line'\n  AND correlation < 0.5   -- low correlation = poor index efficiency\nORDER BY n_distinct DESC;\n```\n\n### Example 3: Use Odoo's Built-In Profiler\n\n```text\nPrerequisites: Run Odoo with ?debug=1 in the URL to enable debug mode.\n\nMenu: Settings → Technical → Profiling\n\nSteps:\n  1. Click \"Enable Profiling\" — set a duration (e.g., 60 seconds)\n  2. Navigate to and reproduce the slow action\n  3. Return to Settings → Technical → Profiling → View Results\n\nWhat to look for:\n  - Total SQL queries > 100 on a single page  → N+1 query problem\n  - Single queries taking > 100ms             → missing DB index\n  - Same query repeated many times            → missing cache, use @ormcache\n  - Python time high but SQL low             → compute field inefficiency\n```\n\n## Best Practices\n\n- ✅ **Do:** Use `mapped()`, `filtered()`, and `sorted()` on in-memory recordsets — they don't trigger additional SQL.\n- ✅ **Do:** Add PostgreSQL B-tree indexes on columns frequently used in domain filters (`partner_id`, `state`, `date_order`).\n- ✅ **Do:** Enable Odoo's HTTP caching for static assets and put a CDN (Cloudflare, AWS CloudFront) in front of the website.\n- ✅ **Do:** Use `@tools.ormcache` decorator on methods pulled repeatedly with the same arguments.\n- ❌ **Don't:** Set `workers = 0` in production — single-threaded mode serializes all requests and blocks all users on any slow operation.\n- ❌ **Don't:** Ignore `limit_memory_soft` — workers exceeding it are recycled between requests; without the limit they grow unbounded and crash.\n- ❌ **Don't:** Directly manipulate `prefetch_ids` on recordsets — rely on Odoo's automatic batch prefetching, which activates by default.\n\n## Limitations\n\n- PostgreSQL tuning (`shared_buffers`, `work_mem`, `effective_cache_size`) is highly server-specific and not covered in depth here — use [PGTune](https://pgtune.leopard.in.ua/) as a starting baseline.\n- The built-in Odoo profiler only captures **Python + SQL** traces; JavaScript rendering performance requires browser DevTools.\n- **Odoo.sh** managed hosting restricts direct PostgreSQL and `odoo.conf` access — some tuning options are unavailable.\n- Does not cover **Redis-based session store** or **Celery task queue** optimizations, which are advanced patterns for very high-traffic instances.","tags":["odoo","performance","tuner","antigravity","awesome","skills","sickn33","agent-skills","agentic-skills","ai-agent-skills","ai-agents","ai-coding"],"capabilities":["skill","source-sickn33","skill-odoo-performance-tuner","topic-agent-skills","topic-agentic-skills","topic-ai-agent-skills","topic-ai-agents","topic-ai-coding","topic-ai-workflows","topic-antigravity","topic-antigravity-skills","topic-claude-code","topic-claude-code-skills","topic-codex-cli","topic-codex-skills"],"categories":["antigravity-awesome-skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/sickn33/antigravity-awesome-skills/odoo-performance-tuner","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add sickn33/antigravity-awesome-skills","source_repo":"https://github.com/sickn33/antigravity-awesome-skills","install_from":"skills.sh"}},"qualityScore":"0.700","qualityRationale":"deterministic score 0.70 from registry signals: · indexed on github topic:agent-skills · 34666 github stars · SKILL.md body (4,578 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-04-23T06:51:41.446Z","embedding":null,"createdAt":"2026-04-18T21:41:50.099Z","updatedAt":"2026-04-23T06:51:41.446Z","lastSeenAt":"2026-04-23T06:51:41.446Z","tsv":"'+1':443 '/)':629 '0':165,546 '0.5':365 '1':106,142,161,248,289,391,404 '1.5':187 '10':296,337 '100':303,437 '1000':285 '100ms':449 '1200':220 '1610612736':186 '2':118,160,171,176,240,268,312,322,414 '2.0':199 '2147483648':198 '3':132,292,377,422 '4':151,339 '60':412 '600':211 '8192':230 '8gb':153 '9':157 'access':659 'action':421 'activ':107,601 'add':270,491 'addit':488 'advanc':680 'also':269 'analysi':131 'argument':541 'asset':517 'attnam':351 'automat':597 'averag':298 'avg':314 'aw':523 'b':494 'b-tree':493 'background':172 'base':670 'baselin':633 'batch':598 'best':471 'bloat':50 'block':557 'bottleneck':44 'browser':649 'buffer':608 'built':61,382,636 'built-in':60,381,635 'cach':459,514,612 'call':316 'capac':182 'captur':641 'caus':130,344 'cdn':521 'celeri':674 'chang':137 'check':340 'click':405 'clock':224 'cloudflar':522 'cloudfront':524 'column':498 'comput':468 'config':125 'configur':17,136,145 'core':152,159 'correl':354,364,367 'cover':52,621,667 'cpu':158,210,213 'crash':207,584 'creat':259 'cron':169,173 'databas':43,90 'date':507 'db':451 'debug':390,397 'decor':533 'default':603 'depth':623 'desc':335,375 'describ':114 'devtool':650 'diagnos':8,32,87,119 'direct':587,655 'distinct':353,374 'domain':502 'durat':283,410 'e.g':411 'effect':611 'effici':370 'enabl':249,396,406,510 'error':84 'exact':135 'exampl':140,141,239,376 'exceed':571 'exec':309,319,333 'exist':263 'expert':5 'explan':139 'extens':253,260 'face':181 'field':469 'filter':476,503 'find':241,293 'fix':10,133 'frequent':499 'front':526 'full':345 'gb':188,200 'get':79,134 'grace':192 'grow':581 'guid':6 'hard':197 'help':31 'high':464,615,685 'high-traff':684 'host':653 'http':513 'id':505,590 'ignor':566 'immedi':204 'in-memori':480 'index':343,369,452,496 'ineffici':470 'ini':146 'instanc':687 'issu':13,117 'javascript':645 'job':174 'keep':175 'kill':203 'leak':238 'left':301 'librari':277 'limit':19,183,195,208,217,228,336,567,579,604 'line':123,362 'load':41,77 'log':86,122,281,286 'look':432 'low':366,467 'manag':652 'mani':456 'manipul':588 'map':475 'max':168,212,221,231 'mean':308,332 'mem':610 'memori':18,49,184,196,237,482,568 'memoryerror':80 'mention':108 'menu':399 'method':535 'min':282 'misconfigur':47 'miss':342,450,458 'mode':398,552 'ms':315,325 'n':352,373,442 'navig':415 'never':162 'numer':311,321 'odoo':2,11,25,35,56,70,93,110,379,388,511,595,638 'odoo-performance-tun':1,109 'odoo.conf':97,147,658 'odoo.sh':651 'oom':206 'oper':563 'optim':677 'option':662 'order':330,361,371,508 'ormcach':461 'overview':28 'page':40,76,441 'partner':504 'pattern':681 'per':215,226 'perform':3,12,26,36,111,116,647 'pg':250,264,278,327,356 'pgtune':626 'pgtune.leopard.in.ua':628 'pgtune.leopard.in.ua/)':627 'poor':368 'postgr':257 'postgresql':20,53,245,492,605,656 'postgresql.conf':272 'practic':472 'prefetch':589,599 'preload':276 'prerequisit':386 'preserv':178 'prevent':205,236 'problem':37,445 'product':74,167,548 'profil':23,63,95,384,402,407,427,639 'pull':536 'put':519 'python':462,642 'queri':15,54,91,243,287,299,302,305,436,444,447,454 'queue':676 'ram':154 'real':219 'receiv':127 'recommend':143 'recordset':483,592 'recycl':191,235,574 'redi':669 'redis-bas':668 'relev':121 'reli':593 'reload':274 'render':646 'repeat':455,537 'reproduc':418 'request':216,227,229,232,555,576 'requir':648 'resolv':34 'restrict':654 'result':429 'return':423 'root':129 'round':307,317 'run':254,387 'sale':360 'scan':347 'schemanam':349 'second':214,225,290,413 'select':300,348 'serial':553 'server':101,155,617 'server-specif':616 'session':671 'set':58,163,400,408,425,544 'share':120,275,607 'singl':440,446,550 'single-thread':549 'size':613 'skill':30,69 'skill-odoo-performance-tuner' 'slow':14,39,72,75,89,242,420,562 'slowest':297 'snippet':306 'soft':185,569 'sort':478 'source-sickn33' 'spec':102 'specif':100,618 'sql':246,435,466,489,643 'start':632 'stat':251,265,279,328,357 'state':506 'statement':252,266,280,284,329 'static':516 'step':247,267,291,338,403 'store':672 'superus':258 'tabl':346 'tablenam':350,359 'take':288,448 'task':675 'technic':401,426 'text':385 'thread':170,551 'time':209,218,310,320,334,457,463 'timeout':78,83 'tool':24,64 'tools.ormcache':532 'top':295 'topic-agent-skills' 'topic-agentic-skills' 'topic-ai-agent-skills' 'topic-ai-agents' 'topic-ai-coding' 'topic-ai-workflows' 'topic-antigravity' 'topic-antigravity-skills' 'topic-claude-code' 'topic-claude-code-skills' 'topic-codex-cli' 'topic-codex-skills' 'total':318,324,434 'trace':644 'traffic':686 'tree':495 'trigger':487 'tune':21,55,96,148,606,661 'tuner':4,27,112 'unavail':664 'unbound':582 'url':394 'use':67,92,378,460,474,500,531,625 'user':180,559 'user-fac':179 'view':428 'wall':223 'wall-clock':222 'websit':529 'without':577 'work':105,609 'worker':16,46,57,82,144,156,189,201,234,545,570","prices":[{"id":"de133011-cbf4-4b4e-b536-f92f87bd4a22","listingId":"6bee6b7d-2ce3-4ab8-932e-20c906d76234","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"sickn33","category":"antigravity-awesome-skills","install_from":"skills.sh"},"createdAt":"2026-04-18T21:41:50.099Z"}],"sources":[{"listingId":"6bee6b7d-2ce3-4ab8-932e-20c906d76234","source":"github","sourceId":"sickn33/antigravity-awesome-skills/odoo-performance-tuner","sourceUrl":"https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/odoo-performance-tuner","isPrimary":false,"firstSeenAt":"2026-04-18T21:41:50.099Z","lastSeenAt":"2026-04-23T06:51:41.446Z"}],"details":{"listingId":"6bee6b7d-2ce3-4ab8-932e-20c906d76234","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"sickn33","slug":"odoo-performance-tuner","github":{"repo":"sickn33/antigravity-awesome-skills","stars":34666,"topics":["agent-skills","agentic-skills","ai-agent-skills","ai-agents","ai-coding","ai-workflows","antigravity","antigravity-skills","claude-code","claude-code-skills","codex-cli","codex-skills","cursor","cursor-skills","developer-tools","gemini-cli","gemini-skills","kiro","mcp","skill-library"],"license":"mit","html_url":"https://github.com/sickn33/antigravity-awesome-skills","pushed_at":"2026-04-23T06:41:03Z","description":"Installable GitHub library of 1,400+ agentic skills for Claude Code, Cursor, Codex CLI, Gemini CLI, Antigravity, and more. Includes installer CLI, bundles, workflows, and official/community skill collections.","skill_md_sha":"3d5bcfffda9fa20a93b3680b89f36f671431bdda","skill_md_path":"skills/odoo-performance-tuner/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/odoo-performance-tuner"},"layout":"multi","source":"github","category":"antigravity-awesome-skills","frontmatter":{"name":"odoo-performance-tuner","description":"Expert guide for diagnosing and fixing Odoo performance issues: slow queries, worker configuration, memory limits, PostgreSQL tuning, and profiling tools."},"skills_sh_url":"https://skills.sh/sickn33/antigravity-awesome-skills/odoo-performance-tuner"},"updatedAt":"2026-04-23T06:51:41.446Z"}}