Discussion:
[tornado] uvloop - speeding up ioloop?
László Nagy
2016-05-16 07:35:30 UTC
Permalink
Hi,

I just came across this benchmark (actually, Guido van Rossum tweeted):

http://magic.io/blog/uvloop-blazing-fast-python-networking/

It seems that tornado's ioloop is not the fastest. AFAIK tornado already
allows us to replace ioloop with Python's built in asyncio event loop. How
hard would it be to add uvloop as an alternative implementation?

What is under the hood? Is it possible that tornado was slow in this
benchmark because it parses/routes http requests at a higher level?

Thanks,

Laszlo
--
You received this message because you are subscribed to the Google Groups "Tornado Web Server" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python-tornado+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Dan Stromberg
2016-05-16 14:01:52 UTC
Permalink
I was looking into a performance issue recently, and noticed that Tornado
was using a 128K blocksize.

Has this been tuned for performance? I've generally found that a little
bigger is faster outside of Tornado.
Post by László Nagy
Hi,
http://magic.io/blog/uvloop-blazing-fast-python-networking/
It seems that tornado's ioloop is not the fastest. AFAIK tornado already
allows us to replace ioloop with Python's built in asyncio event loop. How
hard would it be to add uvloop as an alternative implementation?
What is under the hood? Is it possible that tornado was slow in this
benchmark because it parses/routes http requests at a higher level?
Thanks,
Laszlo
--
You received this message because you are subscribed to the Google Groups
"Tornado Web Server" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
Dan Stromberg
--
You received this message because you are subscribed to the Google Groups "Tornado Web Server" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python-tornado+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Kevin LaTona
2016-05-16 20:02:46 UTC
Permalink
This just came across my newsfeed and I thought some others on the list might enjoy reading it.

It not a technical article about Tornado, rather it talks about about FriendFeed and the problem they were out to solve.

http://kernelmag.dailydot.com/issue-sections/features-issue-sections/16642/friendfeed-history-glue-together-web/


-Kevin
--
You received this message because you are subscribed to the Google Groups "Tornado Web Server" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python-tornado+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Ben Darnell
2016-05-21 17:11:10 UTC
Permalink
Post by Dan Stromberg
I was looking into a performance issue recently, and noticed that Tornado
was using a 128K blocksize.
Has this been tuned for performance? I've generally found that a little
bigger is faster outside of Tornado.
The 128KB block size was chosen because of an issue on windows when trying
to write more than that. It hasn't been evaluated for performance, although
there's speculation in https://github.com/tornadoweb/tornado/issues/1685
that it would be better to increase it on platforms where this doesn't
cause problems.
Post by Dan Stromberg
Post by László Nagy
http://magic.io/blog/uvloop-blazing-fast-python-networking/
It seems that tornado's ioloop is not the fastest. AFAIK tornado already
allows us to replace ioloop with Python's built in asyncio event loop. How
hard would it be to add uvloop as an alternative implementation?
It would be straightforward to add an IOLoop backed by uvloop, and it may
be worth benchmarking this setup, but it's unclear whether it would
actually improve performance. I think the biggest advantage of uvloop is
not libuv itself (which is good, but ultimately it's still making the same
epoll/kqueue calls as everything else), but the fact that so much of the
code above libuv is in cython instead of pure python.
Post by Dan Stromberg
Post by László Nagy
What is under the hood? Is it possible that tornado was slow in this
benchmark because it parses/routes http requests at a higher level?
The benchmark in that post that includes Tornado did not test HTTP at all.
The HTTP benchmarks show that the difference between aiohttp and httptools
is much larger than any difference between the event loops themselves. And
again, the main difference is that httptools is written in cython and C,
while aiohttp is in pure python. I expect tornado's http server would
perform closer to aiohttp than to httptools here.

-Ben
--
You received this message because you are subscribed to the Google Groups "Tornado Web Server" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python-tornado+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Mohammad Puyandeh
2016-05-16 20:57:13 UTC
Permalink
Post by László Nagy
Hi,
http://magic.io/blog/uvloop-blazing-fast-python-networking/
It seems that tornado's ioloop is not the fastest. AFAIK tornado already
allows us to replace ioloop with Python's built in asyncio event loop. How
hard would it be to add uvloop as an alternative implementation?
What is under the hood? Is it possible that tornado was slow in this
benchmark because it parses/routes http requests at a higher level?
Thanks,
Laszlo
Hi
I think you can use it indirectly
You can see here <https://github.com/magicstack/uvloop#using-uvloop> (I
guess both Method will work)and use
tornado.platform.asyncio.AsyncIOMainLoop().install(),
--
You received this message because you are subscribed to the Google Groups "Tornado Web Server" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python-tornado+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Kevin LaTona
2016-05-16 21:07:26 UTC
Permalink
Here is another project that uses libuv via pyuv and this link is a Tornado based example

https://github.com/saghul/tornaduv
Hi,
http://magic.io/blog/uvloop-blazing-fast-python-networking/ <http://magic.io/blog/uvloop-blazing-fast-python-networking/>
It seems that tornado's ioloop is not the fastest. AFAIK tornado already allows us to replace ioloop with Python's built in asyncio event loop. How hard would it be to add uvloop as an alternative implementation?
What is under the hood? Is it possible that tornado was slow in this benchmark because it parses/routes http requests at a higher level?
Thanks,
Laszlo
Hi
I think you can use it indirectly
You can see here <https://github.com/magicstack/uvloop#using-uvloop> (I guess both Method will work)and use tornado.platform.asyncio.AsyncIOMainLoop().install(),
--
You received this message because you are subscribed to the Google Groups "Tornado Web Server" group.
For more options, visit https://groups.google.com/d/optout <https://groups.google.com/d/optout>.
--
You received this message because you are subscribed to the Google Groups "Tornado Web Server" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python-tornado+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
László Nagy
2016-05-17 04:48:11 UTC
Permalink
That is great thanks!
--
You received this message because you are subscribed to the Google Groups "Tornado Web Server" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python-tornado+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...