When is the perfect time to use Tornado in python?

0 votes

Ok, Tornado is non-blocking and quite fast and it can handle a lot of standing requests easily.

But I guess it's not a silver bullet and if we just blindly run Django-based or any other site with Tornado it won't give any performance boost.

I couldn't find comprehensive explanation of this, so I'm asking it here:

  • When should Tornado be used?
  • When is it useless?
  • When using it, what should be taken into account?
  • How can we make inefficient site using Tornado?
  • There is a server and a webframework. When should we use framework and when can we replace it with other one?
Feb 14 in Python by charlie_brown
• 7,720 points
80 views

1 answer to this question.

0 votes

There is a server and a webframework. When should we use framework and when can we replace it with other one?

This distinction is a bit blurry. Only if you are serving static pages, you would use one of the fast server like lighthttpd. Other wise, most servers provides a varying complexity of framework to develop web applications. Tornado is a good web framework. Twisted is even more capable and is considered a good networking framework. It has support for lot of protocols.

Tornado and Twisted are frameworks that provide support non-blocking, asynchronous web / networking application development.

When should Tornado be used? When is it useless? When using it, what should be taken into account?

By it's very nature, Async / Non-Blocking I/O works great when it is I/O intensive and not computation intensive. Most web / networking applications suits well for this model. If your application demands certain computational intensive task to be done then it has to be delegated to some other service that can handle it better. While Tornado / Twisted can do the job of web server, responding to web requests.

How can we make inefficient site using Tornado?

  1. Do any thing computational intensive task
  2. Introduce blocking operations

But I guess it's not a silver bullet and if we just blindly run Django-based or any other site with Tornado it won't give any performance boost.

Performance is usually a characteristic of complete web application architecture. You can bring down the performance with most web frameworks, if the application is not designed properly. Think about caching, load balancing etc.

Tornado and Twisted provides reasonable performance and is good for building a very performant web application. You can check out the testimonials for both twisted and tornado to see what they are capable of

answered Feb 14 by ariaholic
• 7,340 points

Related Questions In Python

+2 votes
3 answers

what is the practical use of polymorphism in Python?

Polymorphism is the ability to present the ...READ MORE

answered Mar 31, 2018 in Python by anto.trigg4
• 3,420 points
1,706 views
0 votes
1 answer

What is the use of raw_input function in Python?

raw_input fuction is no longer available in ...READ MORE

answered May 2, 2018 in Python by aayushi
• 750 points
133 views
0 votes
3 answers

How to get the current time in Python

FOLLOWING WAY TO FIND CURRENT TIME IN ...READ MORE

answered Apr 8 in Python by rajesh
• 1,210 points
91 views
+1 vote
1 answer

What is the correct order to learn concepts in Python for machine learning?

Machine Learning is a vast domain. It ...READ MORE

answered Jul 25, 2018 in Python by Anmol
• 3,620 points
82 views
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6 in Python by Neha
• 330 points

edited Jul 8 by Kalgi 399 views
+4 votes
6 answers
0 votes
1 answer

How to get the size of a string in Python?

If you are talking about the length ...READ MORE

answered Jun 4, 2018 in Python by ariaholic
• 7,340 points
114 views
0 votes
1 answer

How does Python know whether a variable in the class is a method or a variable?

In python objects/variables are wrapped into methods ...READ MORE

answered Sep 18, 2018 in Python by ariaholic
• 7,340 points
60 views