How do web servers like apache do things asynchronously? Does django have relative logic too?

StackOverflow https://stackoverflow.com/questions/22328642

Pergunta

  1. I learn about being asynchronous when i write code with twisted, but i wonder now how do common web servers process thing asynchronously. As a case of this below: apache get a client request from A, and there maybe some operations block the main process. If apache doesn't do some tricks here, then at the just time another client B send a request , and obviously client B will get no response. Right? I guess, every client request will be processed in a dependent process/thread?

  2. And django is a web framework, the question is whether django has the logic about "not blocking", or the work is handled totally by web servers.

Foi útil?

Solução

There are no tricks here, really. Apache simply spins up multiple processes and/or threads (depending on how it is configured), and a request is routed to the next available one.

The logic is exclusively in the web server.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top