[email protected] 1800-212-2022

Explain how Nginx can handle HTTP requests?

Nginx an event based http server that uses the reactor pattern. Although it's a single threaded, but can fork multiple processes to consume several cores. Usually, the main event loop waits for the operating system to signal a readiness event, which means the data can be accessed and read from a socket, at which instance it read into a buffer and processed. The single thread is capable enough to serve tens of thousands of synchronous connections.

Here thread-per-connection model would fail because of the large consumption of memory (as each thread requires its own stack) and the huge context-switching overhead.

Was this answer helpful? #0 #0

Submit Query

Please fill in the form below and we will contact you within 24 hours.