search

Home  >  Q&A  >  body text

Why can nginx handle high concurrency problems?

As the title states, I see that many people are talking about nginx now. Can anyone give a detailed analysis?

曾经蜡笔没有小新曾经蜡笔没有小新2748 days ago679

reply all(2)I'll reply

  • 漂亮男人

    漂亮男人2017-05-16 17:29:32

    Nginx is different from Apache2 in that Nginx adopts a single-threaded, non-blocking, asynchronous IO working model.

    Apache2 creates a new process or thread for each request, which wastes a lot of memory and CPU time, while Nginx uses the IO多路复用技术(epoll) provided by the operating system to process all requests in one thread. When an IO operation starts, Nginx will not wait for the operation to complete before processing the next request. After an IO operation is completed, Nginx will go back and process the subsequent work of the IO.

    reply
    0
  • 阿神

    阿神2017-05-16 17:29:32

    I have a question. Nginx uses short links. Is the advantage of epoll unable to be used? io asynchronous is definitely faster

    reply
    0
  • Cancelreply