El 07/09/16 a les 19:39, Sergio Morillo ha escrit:
> Finally I used uWSGI following the example of previous wsgi tryton patch
> [1] but using new trytond.application.app [2].
Are you using multiple workers?
I'm a little bit curious about how you manage the tryton cache. Are you
using the standard implementation or using another backend (i.e: Redis)?
Also: how you manage to reload the workers when a new module is
updated/installed. Do you reload the services manually?
El 19/09/16 a les 10:26, Ali Kefia ha escrit:
> We faced this problem last year and worked on scaling trytond this way
>
> * Shared Cache on Redis
> * Load balance with Nginx
> * Sync mechanism via redis PUB/SUB to reload Pool
>
> Description of Coog (trytond spécialized ERP)
> here: http://coopengo.com/coog-v1-6-nouvelle-architecture/
> Implementation on a trytond fork: https://github.com/coopengo/trytond
> For more details or help using it, send me an email
AFAIU you need the redis chache and the sync mechaninsm because you have
the wsgi servers running in different machines. Am I right?
>
> Sorry if it is still a custom code, we plan to discuss all this stuff in
> TUB 2016 and hopefully get part of them in tryton out of the box.
Will be great if we can discuss on the ML/BT/discuss server so other
peopole not attending at TUB can also join the discussion ;-)
On 2016-09-19 13:34, Sergi Almacellas Abellana wrote:
> El 19/09/16 a les 10:26, Ali Kefia ha escrit:
> > We faced this problem last year and worked on scaling trytond this way
> >
> > * Shared Cache on Redis
> > * Load balance with Nginx
> > * Sync mechanism via redis PUB/SUB to reload Pool
> >
> > Description of Coog (trytond spécialized ERP)
> > here: http://coopengo.com/coog-v1-6-nouvelle-architecture/
> > Implementation on a trytond fork: https://github.com/coopengo/trytond
> > For more details or help using it, send me an email
>
> AFAIU you need the redis chache and the sync mechaninsm because you have the
> wsgi servers running in different machines. Am I right?
You do not need anything for the cache even if it runs on different
machine. But memory for cache will be used per process.
The pool invalidation is not supported but as the module management is
slowly moved to trytond-admin. I think there are no needs to implement
it.
On 2016-09-19 05:32, Ali Kefia wrote:
> May be I missed something but it is worth asking a question:
> When we have 2 workers, W1 and W2, working on an instance (call it a
> product), how to manage this situation:
>
> - W1 added product to cache (from database)
> - W2 modified product and cleared ITS product cache
> - W1 makes get on product cache => hit an invalid version
>
> We can not check db on each cache.get call?
You can not add to Cache Model instance because they are linked to the
transaction.
The Cache objects only store base type and the invalidation is managed
by the developer with the call to clear.
It is all the cache that is
cleared so it is quite raw but normally Cache should only be used for
data that almost never change.
On 2016-09-19 08:19, Ali Kefia wrote:
> the issue with cache on multi workers is that invalidation does not
> propagate.
Could you proof your statement?
> And since using db is counter cache principle, we took Redis.
I do not understand the reasoning.
> side effect advantages were:
>
> - less locks on Python code
On single-thread it should not change anything.
> - less memory usage (shared memory)
agree even but at the cost of network communication.
> - faster worker startup (since cache is already up and loaded)
except if using threaded workers.
On 2016-09-19 09:07, Ali Kefia wrote:
>
>
> Le lundi 19 septembre 2016 17:40:03 UTC+2, Cédric Krier a écrit :
> >
> > On 2016-09-19 08:19, Ali Kefia wrote:
> > > the issue with cache on multi workers is that invalidation does not
> > > propagate.
> >
> > Could you proof your statement?
> >
>
> Context: multi-process.
> I could miss something (that is why I am asking)
>
> - cache.clear: empty cache and sets ir.cache on database
> - cache.get: reads from memory (does not check ir.cache)
>
> => No synchronization between workers to invalidate cache horizontally
It is done on each request when starting the transaction:
http://hg.tryton.org/trytond/file/tip/trytond/protocols/dispatcher.py#l167
El 19/09/16 a les 18:07, Ali Kefia ha escrit:
> => We will give werkzeug a try (if you have a document that helps on
> configuration, please share)
Using uwsgi you can run trytond with the following command:
uwsgi --http :9090 --module trytond.application:app --processes 4
Le mardi 20 septembre 2016 09:19:12 UTC+2, Sergi Almacellas Abellana a écrit :El 19/09/16 a les 18:07, Ali Kefia ha escrit:
> => We will give werkzeug a try (if you have a document that helps on
> configuration, please share)
Using uwsgi you can run trytond with the following command:
uwsgi --http :9090 --module trytond.application:app --processes 4
I wanna make some testsuwsgi is making load balancing (same job as nginx)? is it made this way?
It's a start, for full reference see the uwsgi documentation.
Hope it helps.
--
Sergi Almacellas Abellana
www.koolpi.com
Twitter: @pokoli_srk
--
You received this message because you are subscribed to the Google Groups "tryton-dev" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/tryton-dev/c1dfe583-90d8-4064-822a-e60d57c240d6%40googlegroups.com.
Hi Ali,
On 20.09.2016 09:32, Ali Kefia wrote:
Le mardi 20 septembre 2016 09:19:12 UTC+2, Sergi Almacellas Abellana a écrit :El 19/09/16 a les 18:07, Ali Kefia ha escrit:
> => We will give werkzeug a try (if you have a document that helps on
> configuration, please share)
Using uwsgi you can run trytond with the following command:
uwsgi --http :9090 --module trytond.application:app --processes 4
I wanna make some testsuwsgi is making load balancing (same job as nginx)? is it made this way?
You should use uwsgi together with nginx as frontend [1]. We have made very good experiences with this combination.
[1] http://uwsgi-docs.readthedocs.io/en/latest/Nginx.html
El 19/09/16 a les 18:07, Ali Kefia ha escrit:
> => We will give werkzeug a try (if you have a document that helps on
> configuration, please share)
Using uwsgi you can run trytond with the following command:
uwsgi --http :9090 --module trytond.application:app --processes 4
El 19/09/16 a les 18:07, Ali Kefia ha escrit:
> => We will give werkzeug a try (if you have a document that helps on
> configuration, please share)
Using uwsgi you can run trytond with the following command:
uwsgi --http :9090 --module trytond.application:app --processes 4