何时以及如何使用龙卷风?什么时候没用? [英] When and how to use Tornado? When is it useless?

查看:116
本文介绍了何时以及如何使用龙卷风?什么时候没用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,龙卷风是无阻塞非常快,它可以处理很多容易站立的请求。

但我想这不是银弹,如果我们只是一味地运行的Django基或任何其他网站与龙卷风它不会给任何的性能提升。

我找不到这个COM prehensive的解释,所以我问在这里:


  • 当龙卷风应该使用?

  • 当它是无用的?

  • 当使用它,应该怎样考虑?

  • 我们怎样才能让低效的使用龙卷风的网站?

  • 有一个服务器和一个webframework。
    我们什么时候应该使用框架,我们什么时候可以跟另外一个替代它?


解决方案

  

有一个服务器和一个webframework。我们什么时候应该使用框架,我们什么时候可以跟另外一个替代它?


这区别有点模糊。只有当你提供静态页面,你会使用类似lighthttpd快速的服务器之一。其他明智的,大多数服务器提供了框架的复杂程度不同来开发Web应用程序。龙卷风是一个很好的Web框架。 Twisted是更加有能力,被认为是一个很好的网络框架。它有很多的协议支持。

龙卷风和扭曲是提供支持非阻塞,异步Web /网络应用程序开发框架。


  

当龙卷风应该使用?
  什么时候没用?
  当使用它,应该怎样考虑?


这是它的本质,异步/非阻塞I / O的伟大工程时,为I / O密集​​型,而不是计算密集型的。大多数网络/网络应用以及适合这种模式。如果你的应用需要做一定的计算密集型任务,那么它必须委托给一些其他的服务,它可以更好地处理它。虽然龙卷风/双绞线可以做Web服务器的工作,响应Web请求。


  

如何我们可以使用旋风低效的网站?



  1. 请任何事情的计算密集型任务

  2. 介绍阻塞操作


  

但我想这不是银弹,如果我们只是一味地运行的Django基或任何其他网站与龙卷风它不会给任何的性能提升。


性能通常是完整的Web应用程序体系结构的特征。你可以打倒大多数Web框架的性能,如果应用程序设计不正确。想想缓存,负载均衡等。

龙卷风和双绞线提供合理的性能,并有利于建立一个非常高性能的​​Web应用程序。您可以检查出的见证两个扭曲和龙卷风,看看他们有能力。

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?

解决方案

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.

这篇关于何时以及如何使用龙卷风?什么时候没用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆