Skip to Content
Odoo เมนู
  • ลงชื่อเข้าใช้
  • ทดลองใช้ฟรี
  • แอป
    การเงิน
    • ระบบบัญชี
    • ระบบการออกใบแจ้งหนี้
    • ระบบบัญชีรายจ่าย
    • ระบบการจัดการข้อมูลผ่านสเปรดชีต (BI)
    • เอกสาร
    • ระบบลงลายเซ็น
    การขาย
    • ลูกค้าสัมพันธ์
    • การขาย
    • POS ร้านค้า
    • POS ร้านอาหาร
    • ระบบสมัครสมาชิก
    • การเช่า
    การจัดการเว็บไซต์
    • เครื่องมือสร้างเว็บไซต์
    • ระบบการขายออนไลน์
    • บล็อก
    • ฟอรั่ม
    • ไลฟ์แชท
    • ระบบการอบรมออนไลน์
    ซัพพลายเชน
    • คลังสินค้า
    • ระบบการผลิต
    • PLM
    • ระบบการจัดซื้อ
    • การซ่อมบำรุง
    • ระบบจัดการคุณภาพ
    ทรัพยากรบุคคล
    • ข้อมูลพนักงาน
    • ระบบสรรหาบุคลากร
    • ระบบการลา
    • การประเมิน
    • ระบบการแนะนำพนักงาน
    • ระบบจัดการยานพาหนะ
    การตลาด
    • โซเชียลมาร์เก็ตติ้ง
    • การตลาดผ่านอีเมล
    • ระบบการตลาดผ่าน SMS
    • ระบบการจัดงานอีเวนต์
    • การตลาดแบบอัตโนมัติ
    • ระบบแบบสำรวจ
    การบริการ
    • โปรเจกต์
    • ระบบบันทึกเวลา
    • ระบบการจัดการบริการภาคสนาม
    • ระบบดูแลช่วยเหลือ
    • การวางแผน
    • การนัดหมาย
    ประสิทธิผล
    • ระบบแสดงความคิดเห็น
    • ระบบการอนุมัติ
    • ไอโอที
    • VoIP
    • คลังข้อมูล
    • WhatsApp
    แอปพลิเคชันของบุคคลที่สาม Odoo สตูดิโอ แพลตฟอร์มคลาวด์ของ Odoo
  • อุตสาหกรรม
    การค้าปลีก
    • ร้านขายหนังสือ
    • ร้านขายเสื้อผ้า
    • ร้านขายเฟอร์นิเจอร์
    • ร้านขายของชำ
    • ร้านขายฮาร์ดแวร์
    • ร้านขายของเล่น
    Food & Hospitality
    • บาร์และผับ
    • ร้านอาหาร
    • อาหารฟาสต์ฟู้ด
    • Guest House
    • ตัวแทนจำหน่ายเครื่องดื่ม
    • Hotel
    Real Estate
    • Real Estate Agency
    • บริษัทสถาปัตยกรรม
    • บริษัทรับเหมา
    • การจัดการอสังหาริมทรัพย์
    • การจัดสวน
    • สมาคมเจ้าของอสังหาริมทรัพย์
    Consulting
    • Accounting Firm
    • Odoo พาร์ทเนอร์
    • เอเจนซี่การตลาด
    • สำนักงานกฎหมาย
    • บริการสรรหาบุคลากร
    • การตรวจสอบและการรับรอง
    ระบบการผลิต
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • ของขวัญขององค์กร
    สุขภาพ & ฟิตเนส
    • ชมรมกีฬา
    • ร้านขายแว่นตา
    • ฟิตเนส
    • ผู้ประกอบวิชาชีพด้านสุขภาพ
    • ร้านขายยา
    • ร้านทำผม
    Trades
    • ช่างซ่อม
    • ฮาร์ดแวร์และการสนับสนุนด้านไอที
    • Solar Energy Systems
    • ช่างทำรองเท้า
    • บริการทำความสะอาด
    • HVAC Services
    Others
    • Nonprofit Organization
    • สำนักงานสิ่งแวดล้อม
    • ร้านเช่าป้ายโฆษณา
    • การถ่ายภาพ
    • ร้านเช่าจักรยาน
    • ตัวแทนจำหน่ายซอฟต์แวร์
    Browse all Industries
  • คอมมูนิตี้
    ศึกษา
    • บทเรียน
    • เอกสารกำกับโปรแกรม
    • การรับรอง
    • การฝึกอบรม
    • บล็อก
    • พอดแคสต์
    เพิ่มศักยภาพให้กับการศึกษา
    • โปรแกรมการศึกษา
    • Scale Up! Business Game
    • เยี่ยมชม Odoo
    รับซอฟต์แวร์
    • ดาวน์โหลด
    • เปรียบเทียบรุ่น
    • เผยแพร่
    ทำงานร่วมกัน
    • Github
    • ฟอรั่ม
    • ระบบการจัดงานอีเวนต์
    • การแปล
    • ร่วมเป็นพาร์ทเนอร์
    • Services for Partners
    • ลงทะเบียนเพื่อสร้างบัญชีบริษัทของคุณ
    รับบริการ
    • ค้นหาพาร์ทเนอร์
    • ค้นหานักบัญชี
    • พบกับที่ปรึกษา
    • บริการติดตั้งระบบเพื่อใช้งาน
    • ข้อมูลอ้างอิงลูกค้า
    • การสนับสนุน
    • อัปเกรด
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    รับการสาธิต
  • ราคา
  • ช่วยเหลือ

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • ลูกค้าสัมพันธ์
  • e-Commerce
  • ระบบบัญชี
  • สินค้าคงคลัง
  • PoS
  • โปรเจกต์
  • MRP
All apps
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
All Posts คน เหรียญรางวัล
แท็ก (View all)
odoo accounting v14 pos v15
เกี่ยวกับฟอรั่มนี้
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
All Posts คน เหรียญรางวัล
แท็ก (View all)
odoo accounting v14 pos v15
เกี่ยวกับฟอรั่มนี้
ช่วยเหลือ

PostgreSQL Idle connections and docker

ติดตาม

รับการแจ้งเตือนเมื่อมีกิจกรรมในโพสต์นี้

คำถามนี้ถูกตั้งค่าสถานะ
postgresqldocker
4 ตอบกลับ
24714 มุมมอง
อวตาร
YannickB

Hello guys,

I am currently hosting a dozen of Odoo databases on one server. I use docker, with one container containing postgresql and five with odoo services. There is not many visitors yet. I use a recent pull of Odoo 8 from github and 9.4 version of postgres (it was the same with 9.1)

My problem is, after a dozen of hours I have almost an hundred of idle process in the postgres container, all related with the Odoo databases. It seems the connections to postgres never close.

I checked SELECT * FROM pg_stat_activity;, it seems the idle query is always COMMIT or ROLLBACK. Do you have any idea where the problem comes and how I can improve the situation? Do you think it's related on the use of docker?

Thanks,
Yannick.

3
อวตาร
ละทิ้ง
Olivier Dony (odo)

Hy, I have the same problem with V7 and postgresql 9.3 and without docker on ubuntu server 14.04.1 After users deconnect from OpenERP, their postgresql process stay active : postgres 23905  1.4  1.7 256692 36996 ?        Ss   10:36   0:05 postgres: openerp7 xxxxxx [local] idle postgres 24019  0.3  1.7 259516 36184 ?        Ss   10:36   0:01 postgres: openerp7 xxxxxxx [local] idle postgres 24631  0.2  1.6 264400 34856 ?        Ss   10:38   0:00 postgres: openerp7 xxxxxxx [local] idle postgres 24452  0.3  1.6 259576 34752 ?        Ss   10:38   0:00 postgres: openerp7 xxxxxxxx [local] idle postgres 23913  0.5  1.6 259252 34424 ?        Ss   10:36   0:02 postgres: openerp7 xxxxxxxx [local] idle postgres 24247  1.2  1.6 256408 34100 ?        Ss   10:37   0:03 postgres: openerp7 xxxxxxxx [local] idle postgres 24534  0.2  1.5 259420 31896 ?        Ss   10:38   0:00 postgres: openerp7 xxxxxxxxx [local] idle Each user (student) has his own database. Thanks Patrick

อวตาร
YannickB
ผู้เขียน คำตอบที่ดีที่สุด

Credit to @panos_xrg and @reis_pt for pointing me in the good direction https://twitter.com/panos_xrg/status/556460140149633026 https://twitter.com/reis_pt/status/556456989170339841

It seems it's the official strategy of Odoo to keep connection to postgres open, at least if what was said in this very old thread https://bugs.launchpad.net/openobject-server/+bug/463219 is still true.

I have a dozen of odoo services connected to the same postgres, each having five database to manage with 4 workers. I still can't found how many connections are opened for each services/database/workers and under which conditions but it doesn't seems to be really controled and it finally reach the 100 connections which is the limit of my postgres configuration.

In the F3 fork @panos_xrg decided to automatically close all connections older that 300seconds https://github.com/xrg/openerp-server/commit/b215015ba0453a. After playing a little with the odoo config, I found that there is a way to achieve the same thing which the official Odoo, it's the db_maxconn parameter.
When the number of opened connection in an odoo service reach the db_maxconn limit, it's seems the oldest connections are automatically closed. Looks like the way to go for me, and I guess that the rules are :

-The sum of all db_maxconn settings for each odoo services connected to the same postgres shall be less that this postgres maxconn configuration.

-The db_maxconn settings for an odoo service shall be high enough to manage the concurrent requests on this service.

So I'll try to set a db_maxconn settings to 10 on each of my odoo services, and I hope this will resolve the problem. I guess this is an important information to have in mind when you want like me to make many odoo services connected to same postgres, and not one big odoo service connected to one postgres (like Odoo SA if I'm not mistaking) nor several odoo services having each their own postgres (like most of the other odoo hosting).

6
อวตาร
ละทิ้ง
Olivier Dony (odo)

Yes using the db_maxconn to this purpose is correct, and your can do the maths when you need to determine the max_connections settings for your PG cluster according to the number of Odoo processes/workers that will connect to it and their db_maxconn setting (keeping in mind that the db_maxconn setting applies *per-process*, so with `--workers` > 1, each worker can have up to db_maxconn open connections.

อวตาร
Patrick Aymar
คำตอบที่ดีที่สุด

" ... each worker can have up to db_maxconn open connections."

Then is there a setting or a way to limit the absolut number of processes ?

Edit : Ok I finally get what this worker stuff is about, learning, learning ...

-1
อวตาร
ละทิ้ง
สนุกกับการพูดคุยนี้ใช่ไหม? เข้าร่วมเลย!

สร้างบัญชีวันนี้เพื่อเพลิดเพลินไปกับฟีเจอร์พิเศษและมีส่วนร่วมกับคอมมูนิตี้ที่ยอดเยี่ยมของเรา!

ลงชื่อ
Related Posts ตอบกลับ มุมมอง กิจกรรม
Odoo 16.0 Docker - Role "odoo" does not exist
postgresql docker
อวตาร
อวตาร
อวตาร
2
พ.ย. 23
4584
When Odoo 14 connects to PostgreSQL 15.7, the connection is idle but cannot be released
postgresql
อวตาร
0
ก.พ. 25
2786
psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: fe_sendauth: no password supplied
postgresql
อวตาร
อวตาร
อวตาร
2
ม.ค. 25
9874
Odoo backend to Google Data Studio แก้ไขแล้ว
postgresql
อวตาร
อวตาร
2
ม.ค. 24
10139
docker-compose resulted in The connection was reset (from firefox) or Empty reply from server (from curl)? แก้ไขแล้ว
docker
อวตาร
อวตาร
2
ก.ย. 23
7967
คอมมูนิตี้
  • บทเรียน
  • เอกสารกำกับโปรแกรม
  • ฟอรั่ม
โอเพนซอร์ส
  • ดาวน์โหลด
  • Github
  • Runbot
  • การแปล
บริการ
  • โฮสติ้ง odoo.sh เซิร์ฟเวอร์
  • การสนับสนุน
  • อัปเกรด
  • การพัฒนาที่กำหนดเอง
  • การศึกษา
  • ค้นหานักบัญชี
  • ค้นหาพาร์ทเนอร์
  • ร่วมเป็นพาร์ทเนอร์
เกี่ยวกับเรา
  • บริษัทของเรา
  • ทรัพย์สินในรูปของเครื่องหมายการค้า
  • ติดต่อเรา
  • งาน
  • ระบบการจัดงานอีเวนต์
  • พอดแคสต์
  • บล็อก
  • ลูกค้า
  • กฎหมาย • ความเป็นส่วนตัว
  • ความปลอดภัย
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo เป็นชุดแอปธุรกิจแบบเปิดที่ครอบคลุมทุกความต้องการของบริษัทของคุณ อาธิ CRM eCommerce ระบบบัญชี ระบบสินค้าคงคลัง ระบบการขายหน้าร้าน โปรเจกต์ และ อีกมากมาย

ความเหนือกว่าอันเป็นเอกลักษณ์ของ Odoo คือการใช้งานที่ง่ายดายและผสานการทำงานอย่างสมบูรณ์แบบในเวลาเดียวกัน

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now