Performance Tips & Tricks

Public Channel / Odoo Experience 2016

There are 3 parts to this short talk:
- 1. An introduction to important aspects of a correct deployment, and 2 examples
- 2. Some advice on how should you be monitoring your Odoo deployment: which metrics in particular, and why it matters.
- 3. Finally, a few tips to help you analyze and troubleshoot a performance situation without wasting hours.

Further information about each topic can be found in more comprehensive talks of previous Odoo Experience, such as:
- http://www.slideshare.net/openobject/performance2014-35689113
- http://www.slideshare.net/openobject/tips-on-how-to-improve-the-performance-of-your-custom-modules-for-high-volumes-deployment-olivier-dony-open-erp

Share on Social Networks

Share Link

Use permanent link to share in social media

Share with a friend

Please login to send this presentation by email!

Embed in your website

Select page to start with

2. 1 Deploying

10. 3 Optimizing

7. 2 Measuring & Monitoring

11. Update your deployment regularly

1. Performance Olivier Dony @odony Tips & Tricks

15. Summary 1 Plan and deploy properly, scale as needed 2 Setup precise monitoring 3 Update, Sample, Optimize This is the basic checklist for performance investigation!  Tech support @ www.odoo.com/help

14. Sample the system while running Odoo Workers Send SIGQUIT to dump worker stacks: kill -3 <odoo_worker_pid> + Easy to send from htop + Repeat to analyze long running transactions

8. Watch your deployment’s performance PostgreSQL : transactions / minute Odoo : requests / minute, avg duration Disk : response time, IOPS System : load, I/O wait, memory Network : connections, bandwidth Establish your performance baseline

13. Sample the system while running PostgreSQL Install pg_activity to watch the database + htop-like for PostgreSQL + Running/Waiting/Blocking queries + Read/Write per second + Pause, kill queries, etc. + CPU/Memory/Load

6. Deployment Architecture Recommendations Setup a reverse proxy in front of Odoo + SSL Termination + Gzip + Serve static assets + Load balancing + Block access to DB manager Backend (DB): max I/O, RAM and Speed 64GB + SSD + 3.5GHz Base CPU speed Frontend (HTTP): max Speed and # Cores 6c/12t 3.5GHz Base CPU speed

3. Deployment Architecture Rules of thumb Activate multi-worker to use your fancy hardware! Worker soft memory limit Dedicated RAM Max = How many workers processes? 1 per CPU core , x2 for recycling Soft limit = 1GB RAM = 24GB e.g. = 24 workers Min = 6 (typical browser keepalive pool size) + Enforce limits + Recycle processes + Perform better + Sync changes How many requests/second? ~ 6-7 x Workers e.g. 24 workers = 160 r/s How many users? ~ 5-10 per Worker e.g. 24 active workers = 180 users

9. Watch your deployment’s performance PostgreSQL : transactions / minute Odoo : requests / minute, avg duration Disk : response time, IOPS System : load, I/O wait, memory Network : connections, bandwidth Suggested tool: Munin  Built-in plugins for most key metrics  Writing plugins is trivial  Constant storage footprint (rrdtool) day week month year  Configurable limits/warnings Exampleplugins  Nginx times: https://git.io/vP3Sj  Odoo times: https://git.io/vP3h9 Establish your performance baseline

4. Deployment Architecture Scaling: example 1 16c /32t Xeon E5 2640v3 – 2.6GHz 64 GB RAM Odoo Server W orkers: 20   100 users  10000 visitors/day Odoo Server (B) W orkers: 20 r e p l i c a t o n Backend + Frontend

12. Optimizing your Deployment PostgreSQL Verify the usual server settings: effective_cache_size, work_mem, shared_buffers  See also documentation: https://wiki.postgresql.org/wiki/Performance_Optimization Log slow queries: log_min_statement_duration = 500  Then watch slow queries in PostgreSQL log file  Use EXPLAIN ANALYZE <query> to verify the plan See also https://explain.depesz.com  Verify statistics and vacuuming (autovacuum!)  Create missing indexes carefully (composite, order, etc.)  Create missing FK indexes to fix slow deletion

5. Deployment Architecture Scaling: example 2 6c /12t Xeon E5 1650v3 – 3.5GHz 64 GB RAM DB + File Server   300 users  25000 visitors/day Odoo Workers: 10 Odoo Workers: 10 Odoo Workers: 10 Load Balancer 4c /8t Xeon E5 1630v3 - 3.7GHz 32 GB RAM  3 X NFS NFS NFS + replicaton of backend Backend Frontend

Views

  • 33 Total Views
  • 3 Website Views
  • 30 Embeded Views

Actions

  • 0 Social Shares
  • 3 Likes
  • 0 Dislikes
  • 0 Comments

Share count

  • 0 Facebook
  • 0 Twitter
  • 0 LinkedIn
  • 0 Google+

Embeds 2

  • 7 accounts.odoo.com
  • 6 onlinesync.odoo.com