tags:

views:

38

answers:

1

I want to understand basics of Event Driven web server, I know one of them is Tornado, but any other information is much appreciated.

Thanks

+2  A: 

A web server needs to handle concurrent connections. There are many ways to do this, some of them are:

  • A process per connection.
  • A process per connection, and have a pool of processes ready to use.
  • A thread per connection.
  • A thread per connection, and have a pool of threads ready to use.
  • A single process, handle every event (accepted connection, data available to read, can write to client, ...) on a callback.
  • Some combination of the above.
  • ...

At the end, the distinction ends up being in how you store each connection state (explicitly in a context structure, implicitly in the stack, implicitly in a continuation, ...) and how you schedule between connections (let the OS scheduler do it, let the OS polling primitives do it, ...).

ninjalj