Coder Social home page Coder Social logo

Add Tornado about web-frameworks HOT 43 CLOSED

greed2411 avatar greed2411 commented on August 19, 2024 1
Add Tornado

from web-frameworks.

Comments (43)

waghanza avatar waghanza commented on August 19, 2024 1

Thanks for the idea.

A PR will be very ❀️

from web-frameworks.

bdarnell avatar bdarnell commented on August 19, 2024 1

Looks fine to me. You don't want to use tornado.wsgi if you don't have to. The one thing you may want to change (depending on how this server is run and if the other frameworks are run in comparable configurations) is to replace http_server.listen(port) with http_server.bind(port); http_server.start(0) to run in multi-process mode.

from web-frameworks.

waghanza avatar waghanza commented on August 19, 2024 1

@greed2411

Framework (Middleware) Requests / s Latency 99 percentile Throughput
sanic 4081.00 273718.00 2009469.33 2.40 MB
japronto 47752.67 21337.33 32104.00 19.44 MB
flask 1143.33 86290.00 104374.33 0.88 MB
django 1176.33 243895.00 4071113.33 0.78 MB
tornado 7054.00 137939.67 294950.67 5.21 MB

from web-frameworks.

waghanza avatar waghanza commented on August 19, 2024

@tbrand Can we close since Tornado was added) ?

from web-frameworks.

greed2411 avatar greed2411 commented on August 19, 2024

Okay, just saw the results, it's at the bottom. And what I gave was just a synchronous version of tornado because there is no db querying or API calls, if that's there as a test, Im sure it would be comparable to Sanic. Could you guys try to include that in a test as well?? Ik the test is just for routing, but still wanted to ask.

from web-frameworks.

waghanza avatar waghanza commented on August 19, 2024

@greed2411 the result will be display on the next release

@tbrand If you don't have time ;-) I can help you releasing this project 😜

from web-frameworks.

waghanza avatar waghanza commented on August 19, 2024

@greed2411 tornado can run on gunicorn
is there any diff between gunicorn and built-in server ?

DISCLAIMER : not a python guy

For example, in ruby world the recommended set-up is to use puma or unicorn (or else) but not the same server as in development mode

@benoitc As the gunicorn author, you'll probably explain this like anyone ❀️

from web-frameworks.

greed2411 avatar greed2411 commented on August 19, 2024

@waghanza yes it can. If I'm not wrong the in built server is wsgi.

I guess someone could rewrite it for gunicorn. Should I look over it?

from web-frameworks.

waghanza avatar waghanza commented on August 19, 2024

@greed2411 sure, as flask also does ( werkzeug) but not recommended for production

I can make the PR (making uniform python implementations), just want to ask before 😜

from web-frameworks.

greed2411 avatar greed2411 commented on August 19, 2024

@waghanza if you are familiar with tornado then please go ahead and do the PR. Please do mention me in the PR. I've never tried gunicorn I wanna have a look. I'd be happy to help anyway possible. Also thanks.

from web-frameworks.

waghanza avatar waghanza commented on August 19, 2024

@greed2411 gunicorn is made to be a production-ready app server in python ;-)

from web-frameworks.

greed2411 avatar greed2411 commented on August 19, 2024

@waghanza Cool. Can't wait to see the results. I just wanna see tornado on top of django nothing else.

from web-frameworks.

waghanza avatar waghanza commented on August 19, 2024

After cloudifying results, I'm sure it will be 😝

I am working on a digitalocean version of the benchmarks

from web-frameworks.

greed2411 avatar greed2411 commented on August 19, 2024

Also one more request @waghanza could you try it with tornado 5?

from web-frameworks.

waghanza avatar waghanza commented on August 19, 2024

@greed2411 sure. I intend to fix any version (in any languages)

from web-frameworks.

greed2411 avatar greed2411 commented on August 19, 2024

Can't wait to see the results. :P

from web-frameworks.

greed2411 avatar greed2411 commented on August 19, 2024

@waghanza last chance for tornado, could you try these, run the results and lemme know?

http://www.tornadoweb.org/en/stable/wsgi.html

I still can't settle with the fact that tornado is slower than flask and django for this task.

Also thanks.

from web-frameworks.

greed2411 avatar greed2411 commented on August 19, 2024

@waghanza the tornado script is performing actually synchronously, there's nothing async about it because we don't have and external api calls or db calls.

but, if I may, can you ask the core contributor, the one man army, bdarnell in the gitter or any personal means to look over the tornado script. Since you are a maintainer, he could take the time and give suggestions.

I don't have the face to ask him, because of me, the script is sitting at 44th place (last position T_T )
He could look at the table from the vibora PR, and let you know whether wsgi should be used, if yes whether we should use tornado.wsgi inside the script, or whether those routes can be handled asynchronously.

could you ask him, please?

from web-frameworks.

waghanza avatar waghanza commented on August 19, 2024

@greed2411 do not be afraid ... you can do it πŸ˜›

@bdarnell could you check our tornado implementation https://github.com/tbrand/which_is_the_fastest/blob/master/python/tornado/server.py. The purpose is to rank frameworks and I'm afraid this implementation is not at tornado's advantage

from web-frameworks.

waghanza avatar waghanza commented on August 19, 2024

@bdarnell thanks for advice.
As we target production-ready app, do you recommand this one, https://github.com/waghanza/which_is_the_fastest/blob/python_standardization/python/tornado/server.py, or the actual is better ?

PS : The goal of this implementation is to run with gunicorn in front

The only goal is to have 3 endpoints :

  • GET on /
  • POST on /user
  • GET on /user/(\d+)

from web-frameworks.

bdarnell avatar bdarnell commented on August 19, 2024

I use Tornado without gunicorn in production; I don't know what gunicorn adds here.

from web-frameworks.

waghanza avatar waghanza commented on August 19, 2024

Log uniformization ;-) same start-up script fot tornado / flask ...

We need to implement what is the best practices for tornado folks 😜

@benoitc Do you recommand using gunicorn on top of tornado ?

from web-frameworks.

greed2411 avatar greed2411 commented on August 19, 2024

The reason we are considering because I still can't believe the fact that flask and Django are out performing tornado's requests/sec, because of gunicorn. Previously before gunicorn, they didn't even make the list.
(Tornado's at the bottom, 44th)

Btw I'm the one who wrote the original script.:relieved:

from web-frameworks.

waghanza avatar waghanza commented on August 19, 2024

@greed2411 I'm sure that tornado will climb after having production-ready results 😝

from web-frameworks.

waghanza avatar waghanza commented on August 19, 2024

@greed2411 you'll be happy πŸ˜› with @bdarnell advices tornado climb on 41th place (and is before django)

  1. ....
  2. tornado (python)
  3. rails (ruby)
  4. flask (python)
  5. django (python)

from web-frameworks.

waghanza avatar waghanza commented on August 19, 2024

Here is a list of what we SHOULD use (as we are target performance 😜)

from web-frameworks.

greed2411 avatar greed2411 commented on August 19, 2024

@waghanza wowowow. Amazing. I never stopped believing in torando, thank the heavens its better than django and flask, btw where can I see the actual results? I wanna see the margin by which we defeated django, also I would like to see the modified tornado script.

from web-frameworks.

waghanza avatar waghanza commented on August 19, 2024

@greed2411 so impatient ... 😜

from web-frameworks.

greed2411 avatar greed2411 commented on August 19, 2024

Yussssssh. I feel overpowered now. I'll go and rub this onto every friend of mine at University. Thanks. I'm looking forward to see these results on readme soon. Good luck and thanks once again @waghanza. You made my dream come true.

from web-frameworks.

greed2411 avatar greed2411 commented on August 19, 2024

But wait. Tornado is faster than Sanic????
You sure???? So the only thing on top of tornado is Japronto and Vibora huh?

from web-frameworks.

waghanza avatar waghanza commented on August 19, 2024

@greed2411 I was NOT using https://github.com/Pylons/waitress at full speed

Framework (Middleware) Requests / s Latency 99 percentile Throughput
sanic 4289.00 291132.67 2697882.00 2.57 MB
japronto 53348.00 20165.33 38664.00 21.56 MB
flask 1149.67 85609.33 104615.00 0.85 MB
django 1008.00 307748.00 4666972.33 0.70 MB
tornado 7219.33 133642.33 274002.33 5.49 MB

⚠️ tornado 5 seems to be faster (results are still on local docker)

from web-frameworks.

greed2411 avatar greed2411 commented on August 19, 2024

Lel. Django slowed down. πŸ˜‚πŸ˜‚πŸ˜‚.
Nonetheless tornado 5 is awesome.

from web-frameworks.

waghanza avatar waghanza commented on August 19, 2024

@bdarnell I ran some tests to see if gunicorn add some performances, and I've found

Appserver Requests / s
Tornado 5640.67
Gunicorn 1835.33
Gunicorn (reuse port) 1719.00
Tornado (reuse port) 7051.00

PS : This is mainly for information (mine) and implementation in this project 😜
PSS : Result are fluctuating due do docker but the ratio is an indicator

from web-frameworks.

benoitc avatar benoitc commented on August 19, 2024

from web-frameworks.

waghanza avatar waghanza commented on August 19, 2024

Hi @benoitc,
I ran some benchmarks and I have

Framework (Middleware) Requests / s Latency 99 percentile Throughput
tornado (code) 7030.67 136106.00 326479.33 5.18 MB
tornado-reuseport (code) 7933.00 123524.33 316101.33 5.37 MB
gunicorn (code) 1181.00 858316.00 5904862.00 0.93 MB
gunicorn-reuseport (code) 1135.00 774897.67 2993184.33 0.88 MB

Gunicorn run with : gunicorn --bind 0.0.0.0:3000 --workers `nproc` -k tornado server:app

from web-frameworks.

benoitc avatar benoitc commented on August 19, 2024

the question is how you run the benchmark. There should be no reason to have a request slower since a tornado server will run on each worker process with gunicorn. Can you share the code of it?

from web-frameworks.

waghanza avatar waghanza commented on August 19, 2024

sure, it is this repo, we use wrk to request server

⚠️ Still on (local) docker, so result are fluctuating (cloudify this in planed)

from web-frameworks.

bdarnell avatar bdarnell commented on August 19, 2024

These new results don't look right to me. I haven't done any performance comparisons myself but I expect Sanic to be faster than Tornado. I also expect that gunicorn -k tornado performs similarly to plain Tornado. Maybe other python configurations also need to be updated to use the right number of processes?

from web-frameworks.

waghanza avatar waghanza commented on August 19, 2024

@bdarnell effectively, I do not understand the diffs between gunicorn and plain tornado

may you try running the code above #131 (comment) ?

from web-frameworks.

bdarnell avatar bdarnell commented on August 19, 2024

I don't understand that difference either. But unfortunately good benchmarking is a lot of hard work, and barely have time to benchmark my own software, much less somebody else's.

from web-frameworks.

waghanza avatar waghanza commented on August 19, 2024

@bdarnell sure, that's could also be a argument for this project ^^

trying to compare tools is a burden, but it we can gather community, I am sure it will be helpful 😜

from web-frameworks.

bdarnell avatar bdarnell commented on August 19, 2024

Absolutely. It's useful work, I'm just not volunteering to do it :)

from web-frameworks.

waghanza avatar waghanza commented on August 19, 2024

no problem at all, anybody will always be welcome, at least when we have time

from web-frameworks.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.