Non-blocking http server , java nio , python tornado eventlet?

Nonblocking servers are the best choice provided all your libraries provides nonblocking apis. As mentioned in your second question if a library blocks (eg database lib making a blocking call), the entire process/thread blocks and the system hangs. Not all of the libraries available are asynchronous which makes it difficult to use tornado/eventlet for all usecases.

Also in a multi-core box multiple instances of nonblocking servers needs to be started to use the box capacity completly Tornado/Event servers are similar to java nio based servers. There is one conceptual difference between a Tornado and Eventlet. Tornado follows a reactor pattern where the single process waits for IO(socket) events and dispatches them to appropriate handlers.

If handlers are nonblocking, best performance can be expected. Typically code written for these frameworks consists of a series of callbacks making it a bit less readable than a synchronous server . Java NIO servers comes under this category Eventlet performs the same task but with a cleaner interface.

Code can be written as in the case of synchronous server without using callbacks. When an IO is encountered, eventlet schedules another userspace process(not right terminology) Apache webapps are more popular that these because of few reasons It is relatively easy to write synchronous code Not all required libraries are asynchronous But for writing a chat application which handles lots of connections a multi-threaded server will not scale. You have to use async frameworks like twisted/event/Java NIO.

Nonblocking servers are the best choice provided all your libraries provides nonblocking apis. As mentioned in your second question if a library blocks (eg database lib making a blocking call), the entire process/thread blocks and the system hangs. Not all of the libraries available are asynchronous which makes it difficult to use tornado/eventlet for all usecases.

Also in a multi-core box multiple instances of nonblocking servers needs to be started to use the box capacity completly. Tornado/Event servers are similar to java nio based servers. There is one conceptual difference between a Tornado and Eventlet.

Tornado follows a reactor pattern where the single process waits for IO(socket) events and dispatches them to appropriate handlers. If handlers are nonblocking, best performance can be expected. Typically code written for these frameworks consists of a series of callbacks making it a bit less readable than a synchronous server .

Java NIO servers comes under this category. Eventlet performs the same task but with a cleaner interface. Code can be written as in the case of synchronous server without using callbacks.

When an IO is encountered, eventlet schedules another userspace process(not right terminology). Apache webapps are more popular that these because of few reasons It is relatively easy to write synchronous code Not all required libraries are asynchronous. But for writing a chat application which handles lots of connections a multi-threaded server will not scale.

You have to use async frameworks like twisted/event/Java NIO.

Note that "multiple instances of nonblocking servers" needn't be completely distinct. A hybrid model with multiple threads (or python's multiprocessing module), each using non-blocking code paths, gets you the best performance, integration, and (usually) administrative ease. – Nicholas Knight Feb 19 at 6:12 You can use multiprocessing and run multiple instance.

But if for some reason you need to share state, then shared memory, queue/named pipes etc will have to be introduced. – Anoop Feb 20 at 5:28.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions