Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

2

How to Tune Postgresql for OpenERP V7 production environment ?

By
Jeudy Nicolas
on 7/20/13, 5:11 AM 6,717 views

Hello,

I would like to know and share what is the better minimum tuning we could do on postgres to have OpenERP V7 in a production environment ?

Postgresql come with conservative setup by default (like @odony said in his slide at OpenDays ).

Think it could be very helpfull to share and have a default one optimized for OpenERP use.

thanks,

4

Thierry Godin

--Thierry Godin--
1516
| 8 7 8
Collegien, France
--Thierry Godin--

..

Thierry Godin
On 6/4/14, 7:40 AM

Hi Nicolas,

Here is the tunning I apply on my (5) servers  (Debian Wheezy)

  1. create an empty file pg_memory.sh in /root directory and copy/paste the code below :

page_size=`getconf PAGE_SIZE`
phys_pages=`getconf _PHYS_PAGES`
shmall=`expr $phys_pages / 2`
shmmax=`expr $shmall \* $page_size`
echo kernel.shmmax = $shmmax
echo kernel.shmall = $shmall
echo 'Edit /etc/sysctl.conf and apply with : sysctl -p'

  1. as root execute command :

bash pg_memory.sh

  1. As notified in the script, copy/paste the result of  the script in /etc/sysctl.conf and execute command :

sysctl -p

  1. You should now have these  parameters at the end of  sysctl.conf (this is an example):

kernel.shmmax = 2107961344
kernel.shmall = 514639

  1. now install pgtune (apt-get install pgtune)
  2. as root, execute command :

pgtune -i /etc/postgresql/9.1/main/postgresql.conf  -o pgsql.conf

  1. This will duplicate the postgresql.conf and add some parameters at the end of the file.
  2. Just open the new file (/root/pgsql.conf)
  3. Copy/past the end of the file (lines with pgtune wizard as comment) in the real one ( /etc/postgresql/9.1/main/postgresql.conf ) . Backup it first!
  4. Restart the server

Note : change path to postgresql.conf according to your OS/Server

PgTune will set parameters according to your system (OS, HD, Memory, etc).

I always trust pgtune and copy/paste "as is" in postgresql.conf. For now, all my servers are running well.

Hope this helps

0
Lithin T
On 8/21/15, 5:37 PM

Dear Thierry Godin,
I have tried tune my postgresql with pg_tune, but still the postgesql is using around 90% of my total cpu(6 core with 1.8Ghz) when taking reports.

Any other solution you have to improve the performance in taking reports like stock valuation ?

0

Gustavo

--Gustavo--
950
| 2 1 4
Buenos Aires, Argentina
--Gustavo--

Python developer, big fan of sailing

Gustavo
On 7/23/13, 3:39 PM

I think the configuration depends on your installation demands. So far we did not get into any trouble with PostgreSQL, other than VACUUM. The later process will surprise you since once it gets started, it virtually stops the server and affects its performance. But you can get it under control.

BTW, I think you can get started by taking a look at this page:

https://wiki.postgresql.org/wiki/Tuning_Your_PostgreSQL_Server/es

Gustavo
on 7/23/13, 3:42 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

3 follower(s)

Stats

Asked: 7/20/13, 5:11 AM
Seen: 6717 times
Last updated: 3/17/16, 5:41 AM