On 28.07.2015 22:15, Ludovic Gasc
This discussion is pretty interesting to try to list when
each architecture is the most efficient, based on the need.
However, just a small precision: multiprocess/multiworker
isn't antinomic with AsyncIO: You can have an event loop in
each process to try to combine the "best" of two "worlds".
As usual in IT, it isn't a silver bullet that will care the
cancer, however, at least to my understanding, it should be
useful for some business needs like server daemons.
I think that should be clear for everybody using any of these
modules. But you are right to point it out explicitly.
If you want to use any AsyncIO server protocol
(aiohttp.web, panoramisk, asyncssh, irc3d), you can use
And if you want to implement by yourself this design
pattern, be my guest, if a Python peon like me has implemented
API-Hour, everybody on this mailing-list can do that.
For communication between workers, I use Redis, however,
you have plenty of solutions to do that.
As usual, before to select a communication mechanism you
should benchmark based on your use cases: some results should
I hope not to disappoint you. I actually strive not to do that
manually for each tiny bit of program (assuming there are many place
in the code base where a project could benefit from concurrency).
Personally, I use benchmarks for optimizing problematic code.
But if Python would be able to do that without choosing the right
and correctly configured approach (to be determined by benchmarks)
that would be awesome. As usual, that needs time to evolve.
I found that benchmark resulted improvements do not last forever,
unfortunately, and that most of the time nobody is able to keep
track of everything. So, as soon as something changes, you need to
start anew. That is not acceptable for me.
Btw. that is also a reason why a I said recently (another topic on
this list), 'if Python could optimize that without my attention that
would be great'. The simplest solution and therefore the easiest to
comprehend for all team members is the way to go. If that is not
efficient enough that is actually a Python issue. Readability counts
most. And fortunately, most of the cases that attitude works
perfectly with Python. :)
Have a nice week.
PS: Thank you everybody for EuroPython, it was amazing ;-)