0

The following discussion has already successfully illustrated that a non-blocking web-server won't do any good/better to traditional web applications.

What is the best way to run Django on Tornado Web Server to have async + django admin + django orm possibilities?

Django is not asynchronous, so running Django in Tornado will remove most of the performance benefits you might get from Tornado.

There exists nonblocking model in Play framework, but it does not pose any special requirement to the web servers (it gave me the impression that just any tomcat or jetty would work, which does not support Tornado's non-blocking model themselves). My question is: How can a traditional web server like Tomcat benefit non-blocking enabled web framework like Play?

Community
  • 1
  • 1
chen
  • 4,302
  • 6
  • 41
  • 70

1 Answers1

3

Asynchronous serving of HTTP requests (when one thread can serve multiple HTTP requests) is available starting from Servlet API 3. Tomcat 7 and Jetty 8 support Servlet API 3.

There are no much benefits for running Play/Akka apps on older servlet 2 containers, because request will not release thread allocated for it for its whole lifecycle. However, async features and Akka actors can be handy even in this case, for some background processing tasks.

Django is really non-asynchronous. Tornado is asynchronous internally, i.e. it allows to handle multiple TCP connections in single thread, but when tornado.wsgi is used to interoperate with Django, it allocates a thread for request, calls WSGI callable in it, and this thread is allocated to this single request for its whole lifetime. WSGI is something like Servlet API 2.

kolen
  • 2,752
  • 2
  • 27
  • 35