Odoo Performance · advanced · 10 min read
API Performance Optimization
Speed and stabilize Odoo XML-RPC, JSON-RPC, and REST endpoints: payload design, authentication cost, rate limits, batch endpoints, and integration-friendly ORM patterns.
Last reviewed 2026-07-30 · Estimated effort: 6+ weeks for multi-team change
Table of contents
Odoo APIs — XML-RPC, JSON-RPC, and custom HTTP controllers — share workers and ORM with interactive users. Chatty integrations that call read per id or search per SKU multiply latency and lock contention under peak order volume.
Optimize payloads: request only needed fields, use search_read with domains and limits, batch creates where idempotency allows, and defer heavy processing to queue jobs returning job ids.
Rate limiting, authentication caching, and dedicated integration users with minimal permissions reduce abuse risk and audit noise. Shopify and marketplace connectors should follow the same batch and queue patterns described in the integration pillar.
External systems often treat Odoo as a row-by-row database — thousands of round trips for one catalog sync. Workers saturate, PostgreSQL connection pools exhaust, and warehouse users see spinners while the connector retries.
This article targets API and integration performance on Odoo. Implement fixes in modules via Development standards; route bulk work through queues per background jobs guidance.
Every search_read should specify fields explicitly. Avoid default read that pulls chatter, followers, and unused relations. For large id sets, chunk ids into batches sized for stable response time on your network.
Use domains that hit indexed columns. Prefetch related ids in one query instead of nested reads from middleware loops.
- ▸Cap limit on search calls — paginate with offset or id cursor
- ▸Prefer write on batched vals for status updates
- ▸Return external id maps from custom endpoints for idempotency
- ▸Compress large JSON responses at reverse proxy when safe
Webhook handlers should validate signature, enqueue work, and return quickly — not import full orders synchronously. Long HTTP requests hold workers and risk duplicate delivery on timeout retries.
Custom controllers that perform multi-document creation should mirror queue chunk patterns and return 202 with job reference when processing exceeds a few seconds.
Session-based API auth has cost per request. API keys and OAuth patterns appropriate to your Odoo version should be documented for integrators. Rotate credentials without sharing admin passwords.
Apply rate limits at reverse proxy or application layer for public endpoints. Burst allowance should match legitimate connector batching — block runaway scripts before they degrade ERP users.
Custom endpoints bypass standard ORM optimizations if implemented naively. Profile controller code with the same tools as server actions — query count, Python time, serialization cost.
Version external APIs and avoid breaking field renames without deprecation — integrators caching old schemas can accidentally trigger expensive fallback searches.
- ✓Publish integration guidelines with batch sizes and required field lists.
- ✓Move order and catalog sync processing to queue jobs by default.
- ✓Monitor RPC p95 and error rate per integration user or API key.
- ✓Load-test connectors at peak multiplier before Black Friday or launch.
- ✓Align Shopify webhook design with queue channels and backpressure.
- ✓Review Development checklist for any new public controller routes.
- !Calling read() inside a loop for each record id from middleware.
- !Synchronous order import on webhook without timeout-safe idempotency.
- !Using admin credentials for daily sync jobs.
- !Unbounded search without limit returning entire product catalog.
- !Returning huge binary fields in JSON for every product row.
- !Ignoring 429 or retry-after semantics on outbound API calls to Odoo.
API performance is integration design: batch reads, async writes, slim payloads, and monitoring per connector — not unlimited synchronous RPC.
Next, instrument production to catch RPC regression and queue lag before channel operations stop.
API client
Gateway / auth
Odoo controllers / RPC
Database
- clientgw
- gwodoo
- odoodb
Request
HTTP / RPC enters Odoo.
Auth & ACL
Users, groups, record rules.
ORM work
Reads/writes with business logic.
Response
UI, API payload, or job enqueue.
| Option | Best when | Trade-off |
|---|---|---|
| Configure | Standard Odoo covers the need | Limited uniqueness |
| Customize | Differentiating workflow | Upgrade cost |
| Integrate | External system of record | Sync complexity |
Frequently asked questions
XML-RPC or JSON-RPC for performance?
Performance differences are usually minor versus payload design. Choose based on client library support and monitoring familiarity — optimize batching and fields first.
Should integrations use a dedicated Odoo worker?
Some estates route /jsonrpc through dedicated workers or instances for isolation. Evaluate when integration traffic routinely competes with warehouse peak.
How does this relate to Shopify integration?
Shopify connectors are heavy API consumers — see Shopify pillar articles on webhooks, queues, and rate limits for channel-specific patterns.
When to build custom REST vs standard RPC?
Custom REST helps when you need stable contracts, combined operations, or enqueue-only responses. Maintain profiling and versioning discipline via Development practices.
Related articles
Background Jobs and Queue Optimization
Keep Odoo responsive under load: cron design, queue_job channels, worker allocation, job chunking, and integration backpressure for high-volume sync.
View →ORM Performance Best Practices
Odoo ORM patterns that scale: batch operations, prefetch, domain design, computed fields, and avoiding N+1 on sale, stock, and accounting paths.
View →Monitoring Odoo in Production
Observability for live Odoo: RPC latency, worker health, PostgreSQL metrics, queue lag, cron duration, and alerting runbooks tied to business workflows.
View →Scaling Odoo for Growth
Grow Odoo capacity deliberately: vertical vs horizontal workers, database headroom, read replicas for reporting, multi-company load, and integration scale paths.
View →Related services
Odoo Performance Optimization
Diagnosis and remediation for slow production Odoo — ORM, workers, and operations.
View →Dedicated Odoo Developer
Reserved capacity for profiling, module fixes, and performance backlog.
View →Odoo Support
Monitoring, incident response, and AMC for live performance-sensitive systems.
View →Connectors stressing Odoo workers?
Share integration types, call volume, and timeout patterns — we will review batching, queue handoff, and rate limits.
