# WSGI Server choice

**URL:** https://discuss.tryton.org/t/wsgi-server-choice/2766
**Category:** Developer
**Created:** [May 25, 2020, 9:37am UTC](https://discuss.tryton.org/t/wsgi-server-choice/2766 "2020-05-25T09:37:50Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![maxx](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/maxx/32/2320_2.png) [@maxx](https://discuss.tryton.org/u/maxx)
#### Post date: [May 25, 2020, 9:37am UTC](https://discuss.tryton.org/t/wsgi-server-choice/2766/1 "2020-05-25T09:37:50Z")

</div>

Hi,  
Just for information…  
Why choosing uwsgi as wsgi server (tryton docker)?  
I know there’s a lot of alternatives (gunicorn, waitress, …)  
I saw on multiple benchmarks that Bjoern ([GitHub - jonashaag/bjoern: A screamingly fast Python 2/3 WSGI server written in C.](https://github.com/jonashaag/bjoern)) has the best performances?  
What is the best choice?  
What do you use in production environment?

---

<div class="post-metadata">

### Author: ![albert](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/albert/32/21_2.png) [@albert](https://discuss.tryton.org/u/albert)
#### Post date: [May 25, 2020, 9:58am UTC](https://discuss.tryton.org/t/wsgi-server-choice/2766/2 "2020-05-25T09:58:22Z")

</div>

> [@maxx](#):
>
> I saw on multiple benchmarks that Bjoern ([GitHub - jonashaag/bjoern: A screamingly fast Python 2/3 WSGI server written in C.](https://github.com/jonashaag/bjoern)) has the best performances?

When we did our benchmarks several years ago bjoern came ahead but only because it was single threaded. As soon as we configured mod\_wsgi (apache) in single thread, both where equally fast (and I bet you wouldn’t notice any difference with gunicorn or uwsgi either) for real world Tryton usages.

I also bet the benchmarks you saw (which were probably the ones we saw) were using several threads for all candidates (except bjoern), that’s why it came ahead.

Also, although I cannot prove it, my feeling is that the multi-thread performance issues came from werkzeug and probably those were improved in the library.

---

<div class="post-metadata">

### Author: ![albert](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/albert/32/21_2.png) [@albert](https://discuss.tryton.org/u/albert)
#### Post date: [May 25, 2020, 9:59am UTC](https://discuss.tryton.org/t/wsgi-server-choice/2766/3 "2020-05-25T09:59:35Z")

</div>

> [@maxx](#):
>
> What do you use in production environment?

We’re happily using mod\_wsgi since Tryton 4.0 with no issues so far.

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [May 25, 2020, 1:36pm UTC](https://discuss.tryton.org/t/wsgi-server-choice/2766/4 "2020-05-25T13:36:14Z")

</div>

I made the choice of µwsgi mainly because it is packaged in Debian and also because it is not written in Python.  
I would not want to increase the complexity with a server written also in Python which must evolve at the same speed as Tryton.  
But at the end, the WSGI server has not big impact on the feeling of the Tryton speed. If a request seems slow it is almost always because the Python method not because of the network layer.

> [@albert](#):
>
> Also, although I cannot prove it, my feeling is that the multi-thread performance issues came from werkzeug and probably those were improved in the library.

This is mainly because of the GIL so of Python. But things are improving thanks to projects like Gilectmony, subinterpreter, HPy etc.

---

<div class="post-metadata">

### Author: ![nicoe](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/nicoe/32/2880_2.png) [@nicoe](https://discuss.tryton.org/u/nicoe)
#### Post date: [May 25, 2020, 3:38pm UTC](https://discuss.tryton.org/t/wsgi-server-choice/2766/5 "2020-05-25T15:38:21Z")

</div>

> [@ced](#):
>
> This is mainly because of the GIL so of Python. But things are improving thanks to projects like Gilectmony, subinterpreter, HPy etc.

Let’s do like everybody and rewrite Tryton in Rust 😃 !
