Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 953515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T00:03:52+00:00 2026-05-16T00:03:52+00:00

I found there are a lot of articles comparing Nginx and Apache in Internet.

  • 0

I found there are a lot of articles comparing Nginx and Apache in Internet. However, all these comparisons are based on stress test to web server running PHP code. I suppose this is mainly due to Apache is generally deployed with PHP as LAMP architecture.

In my understanding, Nginx is created to solve C10K problem with event-based architecture. That is, Nginx is supposed to serve M concurrent requests with N threads/processes. N is supposed to much less than M. This is a big difference from Apache which needs M threads/processes to serve M concurrent requests.

For PHP code, the programming model is not asynchronous. Each web request would occupy one thread/process for PHP to handle it. So, I don’t understand the meaning to compare Nginx and Apache with PHP code.

The event-based architecture of Nginx must excels Apache especially when requests involves I/O operations. For example, requests need to merge results from multiple other web services. For Apache+PHP, each requests might takes seconds just waiting for I/O operation complete. That would consume a lot of threads/processes. For Nginx, this is not a problem, if asynchronous programming is used.

Would it make more sense to deploy Nginx with language supporting asynchronous programming model?

I’m not sure which programming language could dig most potential from Nginx, but it id definitely not PHP.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T00:03:53+00:00Added an answer on May 16, 2026 at 12:03 am

    First and foremost, nginx does not support any application execution directly.
    It can serve static files, proxy requests to any other webserver and some other small things.
    Historically, nginx aimed to handle many network connections, true, but the rationale was this:
    until apache respond to the request of someone on slow connection, it can do nothing.
    Apache has a limit of workers, so when there are lots of slow clients, anyone new have to wait until
    a worker finishes the transfer and resumes accepting new request.
    So the classic setup is nginx accepting external requests, proxying them to the local apache;
    apache handles the requests and gives back the responses to the nginx to transfer to the clients.
    Thus apache is eliminated from dealing with clients.

    Regarding the question and nginx in the picture. It’s not that hard to utilize
    system event frameworks these days. That’s epoll for Linux, kqueue for FreeBSD
    and others. At the application level lots of choices, twisted for python for
    example. So all you have to do is to write application with these frameworks,
    which 1) usually put you in async world and 2) give you a way
    to build HTTP service, ready to be backend for nginx.
    That’s probably where you are aiming at.

    So, c10k doesn’t seem to be a problem for nginx,
    nor for applications built around these frameworks.
    Example at hand is friendfeed’s tornado server:
    python written, uses epoll and kqueue depending on the system,
    handles up to 8k easyly, as i recall. There were some benchmarks
    and afterthought to scale it further.

    Something must be brewing in ruby world about all the async trend,
    so they can come up with, if they haven’t already.
    Ruby’s passenger and mongrel, whatever in essense they are (i’m blanking on this),
    do work with nginx, and this required writing modules for nginx.
    So the community takes nginx into account and does extra when it needs to.

    Php, by the way, stays relevant for pushes when websockets massively deployed. Oh well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I'm using some jQuery that I found online. There's a lot of variations
There are a lot of articles about how to save a state of a
I've looked all around Google and its archives. There are several good articles, but
I have been through solutions and found that there are a lot of ways
I found there're two different opinions about how greedy regex is executed: one is,
I found there are also a pthread in Boost library, is it the same
Every LINQ blog I found there seemed around 2 years old, I understand the
I read the Intel manual and found there is a lock prefix for instructions,
I was refactoring some code and found there are two places that can be
After running exec sp_lock on one of our databases we found there's close to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.