Multiple Tryton server with one back-end DB

173 views
Skip to first unread message

Khurram Shahzad

unread,
Aug 1, 2017, 2:38:10 PM8/1/17
to tryton
Dear all,
Is it possible to have multiple Tryton server running on same or different machines but connecting to same database? This might help load balance and achieve high availability by putting tryton server behind proxy server! Can also help overcome single-core limitation of Python!

Regards,
Khurram.

Francisco Maria Moyano Casco

unread,
Aug 2, 2017, 2:55:07 AM8/2/17
to tryton

Khurram
        If all the Tryton server have the exactly same modules, theorically, yes. In the next weeks I am going to try something like that with Raspberry pi.
Regards
     Francisco

Jean Cavallo

unread,
Aug 2, 2017, 3:11:01 AM8/2/17
to try...@googlegroups.com
Hi,

> Is it possible to have multiple Tryton server running on same or different machines but connecting to same database? This might help load balance and achieve high availability by putting tryton server behind proxy
> server! Can also help overcome single-core limitation of Python!

You *will* have cache problems, because default cache is in memory, so resets may not be triggered in all server instances. Consider using https://bitbucket.org/pokoli/redis-tryton to solve this. We are using multiple tryton instances with an nginx server, so I can confirm it works.

Jean Cavallo
Coopengo

Sergi Almacellas Abellana

unread,
Aug 2, 2017, 3:27:22 AM8/2/17
to try...@googlegroups.com
El 02/08/17 a les 09:10, Jean Cavallo ha escrit:
We are also using multiple instances with a nginx load balancer in front
and with redis-tryton.

P.S: redis-tryton is available on pypi too:
https://pypi.python.org/pypi/redis_tryton/0.2

--
Sergi Almacellas Abellana
www.koolpi.com
Twitter: @pokoli_srk

Cédric Krier

unread,
Aug 2, 2017, 3:45:06 AM8/2/17
to try...@googlegroups.com
On 2017-08-02 09:10, Jean Cavallo wrote:
> Hi,
>
> > Is it possible to have multiple Tryton server running on same or
> different machines but connecting to same database? This might help load
> balance and achieve high availability by putting tryton server behind proxy
> > server! Can also help overcome single-core limitation of Python!
>
> You *will* have cache problems, because default cache is in memory, so
> resets may not be triggered in all server instances.

Wrong, the cache is reset on all instances:
http://hg.tryton.org/trytond/file/default/trytond/transaction.py#l106
http://hg.tryton.org/trytond/file/default/trytond/transaction.py#l207

But if you know an issue, please fill it on bugs.tryton.org.

> Consider using
> https://bitbucket.org/pokoli/redis-tryton to solve this. We are using
> multiple tryton instances with an nginx server, so I can confirm it works.

This only helps to reduce the memory consumption of each instances which
makes sense if you run many instances on the same host.
But I'm not sure that it is faster than consuming memory on each host
except of maybe if you run a redis server on each hosts to use local
connection but in this case the memory saving should not be that much.

--
Cédric Krier - B2CK SPRL
Email/Jabber: cedric...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

Khurram Shahzad

unread,
Aug 3, 2017, 3:16:16 AM8/3/17
to try...@googlegroups.com
Dear All,
I am very thankful to all. So, I will first install redis-tryton with my Tryton Server and then user HAProxy for load balancing.
--
 
Regards,
Khurram.
Reply all
Reply to author
Forward
0 new messages