Technical mailing list archives

technical@mail.odoo.com

Avatar

Re: [Odoo11] Improve performance by configuration worker > 0 casuse Exception bus.Bus unavailable

by
O Dooist
- 2018年08月28日 06時43分15秒
> I suspected that you are not installed module(s) that required Live chat or IM bus cause you never see errors exception mentioned.
LOL :-)
This error is caused because Odoo UI chat module is calling /longpolling/poll and it's served by a worker instance not gevent one.
So do not visit Odoo using http://odoo_addres:8069/, instead proxy it with nginx where as described here https://www.odoo.com/documentation/11.0/setup/deploy.html#livechat

Regards,


пн, 27 авг. 2018 г. в 10:06, apisak Srihamat <apisak.srihamat@octcorp.site>:
Dear Technical Team,

FYI:

According to Odoo support team, I was informed that deployment method is important to make it work.

Basically, I was told that prcess-based preforking is not working when enabled Live chat. We need to either deploy in thread mode or gevent mode.
As my experiment, IM bus is required by Live chat (And many modules such as web, sales and crm etc. Those modules are referring to IM bus).
Once we enabled workers > 0 then run in prefork mode then it's expected exception error by Odoo itself.

Dear Can Tecim,

Since you executed in prefork mode, I suspected that you are not installed module(s) that required Live chat or IM bus cause you never see errors exception mentioned.
Please let me know if my suspectation is correct.

Regards,
Apisak Srihamat


On Wed, Aug 15, 2018 at 12:05 AM, apisak Srihamat <apisak.srihamat@octcorp.site> wrote:
Dear Can Tecim,

Many thanks, your suggestion saved my day and night.

As debuged, there is only one @route for '/longpolling/poll' which get called when we changed workers > 0. It's in Module IM Bus in Class BusController method poll. Which will raise particular Exception when dispatch not get set. 

I thought it must only get set in Module IM Bus in Model's bus.py since you confirmed you don't have this problem then it allowed me to think that it can be set some where else.

We have to look into the reason why we don't have object dispatch then.

Regards,
Apisak Srihamat


On Tue, Aug 14, 2018, 15:44 Can Tecim <cant@projetgrup.com> wrote:

In multiprocessing mode (worker > 0), it will automatically spawn a process with 'gevent' attribute to handle longpolling, I don't have this issue.


If you dig into source code, you'll se what I mean, look at long_polling_spawn method in odoo/service/server.py
see also: run method of PreforkServer class

Best Regards,,
Can Tecim, CTO
Projet Grup

apisak Srihamat <apisak.srihamat@octcorp.site> şunları yazdı (14 Ağu 2018 10:23):

Dear Technical Team,

We are exploring performance improvement method by changed odoo configuration worker > 0 then we found an error Exception("bus.Bus unavailable").

By dig into details in module "IM bus", we realized that object "dispatch" (ImDispatch) only created when running in gevent mode (not prefork mode which workers > 0)
In my understanding, I think who configured workers > 0 and run prefork mode will face this error, is that correct ?
What do you guy do to avoid this exception error ?
Or you guy found this exception error but ignored ?


Please note that we already modified nginx to reverse proxy /longpolling to port 8027 for longpolling request as explained in:
The request arrived to @route poll in controller of module "IM bus" but raise an exception as mentioned. Without looking closely in log file you may not see it.

The reason I asked is, I think we need to either:
1. Modify/add handler of longpolling in prefork mode. (If required) 2. Remove longpolling in prefork mode. (If not required)
Before doing some of those, I curious how technical team handle this exception after config workers > 0.

Regards,
Apisak Srihamat

_______________________________________________
Mailing-List: https://www.odoo.com/groups/technical-62
Post to: mailto:technical@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe


_______________________________________________
Mailing-List: https://www.odoo.com/groups/technical-62
Post to: mailto:technical@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe


_______________________________________________
Mailing-List: https://www.odoo.com/groups/technical-62
Post to: mailto:technical@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe

Reference