
Nginx just became the most used web server among the top 1000 websites - MarionG
http://w3techs.com/blog/entry/nginx_just_became_the_most_used_web_server_among_the_top_1000_websites
======
jtchang
I just want to say how incredibly lucky I feel to have two very mature and
high performing OSS web servers.

Both nginx and Apache are absolutely solid pieces of software. I wish we had
as many alternatives to Microsoft Excel as we do IIS.

~~~
kogir
I've always found it interesting that of the major Web servers IIS is the only
one with a programmatic configuration API.

~~~
beachstartup
generating and modifying unix config files programmatically has been happening
for nearly half a century

the only reason a web daemon has an API in windows is because the windows
registry is opaque, error-prone and in general, a giant piece of shit.

~~~
Osiris
IIS configurations are stored in web.config and other XML files that are
easily editable.

~~~
nahname
Nothing easy about editing a couple thousand line xml file. Especially when
it's on the server and you have to do it with notepad.

~~~
GFischer
It being on the server precludes opening an IDE?

That said, I agree that it would be better if it isn't a thousand lines, and
maybe there are better options than XML.

The company I work for is a Microsoft shop (for now, switching to Java sadly),
and I've edited a lot of web.configs in servers, sometimes using Notepad, and
it wasn't much of a hassle (though I did have to research what to edit
beforehand in some cases).

~~~
thirsteh
You have IDEs installed on your production servers...?

------
nkozyra
I wonder how much of this is actually a reverse proxy to apache, though.

~~~
machbio
A major chunk of PHP based applications would be doing these, else it would be
standalone Nginx serving static files for the most part of the servers..

~~~
adPothier
Nginx works very well with PHP-FPM through FastCGI, and there is about zero
configuration needed as everything is up and running after an apt-get (minus
some commented configuration regarding php in Nginx).

I think more and more php-based app are powered by this kind of stack.

~~~
nkozyra
I've seen a good number of benchmarks that show modphp for Apache to be as
fast or faster than FastCGI on nginx. If you're running a PHP application I'm
not sure there's a huge impetus to switch from nginx over apache to just nginx
(other than reducing a point of failure).

~~~
andmarios
Of course modphp would be faster as php becomes part of Apache with this
approach. The problem is that not every Apache process is going to serve php.
Most of them will be serving static files but will have the overhead of the
embedded php library. The real overhead though comes due to that you can't
control how many Apache processes serve php and how many static files.
Processing php eats a lot of RAM and you can quickly bring you server down to
its knees. You could opt for less Apache processes but then you would end up
serving much less visitors.

Anyway, Apache these days is mostly set-up with fastcgi or php-fpm due to
these issues and this has the added good that you can use the worker or event
mpm, though most benchmarks are still with the older prefork mpm.

~~~
kalleboo
So if all your static files are on a CDN and your web server is only hosting
dynamic content, Apache is still the better choice for PHP applications?

------
mike-cardwell
And yet, according to Netcraft yesterday:

    
    
      "Apache and nginx, both open source web servers, have 
      lost market share this month whilst Microsoft gained 
      significantly, up by 2.43 percentage points, to just shy 
      of 20% of worldwide sites. For the second consecutive 
      month, nginx is powering fewer sites than in the previous 
      month's Web Server Survey, which is due, in part, to 
      almost 2M sites moving from nginx and to Apache. Within 
      the million busiest sites, a similar picture emerges: 
      nginx lost over 4,000 busy sites, many of which have 
      moved to Apache."
    

[http://news.netcraft.com/archives/2013/07/02/july-2013-web-s...](http://news.netcraft.com/archives/2013/07/02/july-2013-web-
server-survey.html)

~~~
mstrem
Just for clarity, the numbers reported by Netcraft in the monthly survey blog
post are referencing all sites, active sites, and top 1M sites.

Not to saying that the picture may not be different in the top 1k.

------
babuskov
There are two trends here.

Many people recognize that it's much cheaper to place nginx in front of other
web servers than to buy more servers. We could say that nginx is mainstream
now, so any serious website would use it. If you take "top million websites"
instead of "top 1000", you might see different percentages. Automated tests
just see nginx in the header, although something else is the actual workhorse
for the site.

Some of the stuff does not need Apache anymore. As I moved almost all my
projects from PHP to Node.js, there's little use for Apache now. And nginx
serves static content with less CPU and RAM.

~~~
singlow
No reason to use Apache for PHP - I run all of my PHP sites on nginx with php-
fpm or fastcgi. It has been much easier for me to manage performance,
especially on low-memory VPSs with php running in a separate process. I
suppose it would work just as well with Apache behind nginx, but I don't see
any good reason to have it in the way unless you rely on htaccess files.

~~~
ciclista
Same here, much lower memory print compared to Apache, and it's fast and easy
to configure/set up.

~~~
zapt02
What kind of opcode cache do you employ? Depending on how you set up APC for
example, php-fpmcan use much more memory than running Apache mod_php with one
shared segment.

------
future_grad
Student here.

Why is Nginx more popular than G-WAN?

I saw the benchmarks for G-WAN earlier this week
([http://gwan.com/benchmark](http://gwan.com/benchmark)) and am curious why
most people would choose nginx over the performance that G-WAN provides?

~~~
FooBarWidget
Other than claims by the author of G-WAN, I've yet to see anybody claiming
that G-WAN outperforms Nginx. I also cannot find any evidence of anybody using
G-WAN in serious production. I could be wrong of course, but every time I've
inquired about it, nobody responds. I also cannot find any kind of community
around G-WAN.

Also, it seems that a lot of the "performance" in G-WAN is thanks to its
microcaching feature. When it's under high concurrent load, it caches requests
for about 1 second. I suppose it's useful on public cacheable responses and
useful in benchmarks, but does this really count as "faster" in the sense that
G-WAN is a faster system overall? I don't know.

That being said, G-WAN has many interesting aspects indeed.

~~~
jlgreco
> _Other than claims by the author of G-WAN_

It doesn't really help that the author gives off some mild "losethos" style
vibes (the rantings about open source software, the weird "buy an encrypted
archive of the source" thing, etc.)

I'm sure it is very impressive in some very limited circumstances, but it
really isn't something that I want to get close to. I can't trust people so..
untrusting.

~~~
icebraining
Speaking of losethos, the guy hasn't posted in twenty days, which is an hard
break from his routine. I hope he's OK.

~~~
jlgreco
Hmm, you're right. Maybe the NSA stuff has scared him offline.

------
SideburnsOfDoom
It's likely that our website would be counted as nginx since the response
headers include "Server: nginx...". And there is an nginx load-balancing layer
at the front.

But it's a pretty thin layer with the real "web servers" behind it.

~~~
unreal37
Same here. I'm working with a big corporate client who is installing nginx box
in front of an IIS one. The IIS box does the work, the nginx handles security,
user throttling and reporting.

And no one will know IIS is behind it because it's a proxy. These stats don't
tell the whole story.

------
jstanley
It would be interesting to see what they consider the top 1000 websites to be.
Does anyone know if their list is public?

EDIT: Found it. This post
[http://w3techs.com/blog/entry/w3techs_surveys_are_now_based_...](http://w3techs.com/blog/entry/w3techs_surveys_are_now_based_on_the_top_10_million_sites)
implies they are using Alexa's rankings.

------
GeneralMayhem
Also note the inverted shape of the trends: Apache is much more popular among
less visited sites, but gets less so as you go up. nginx is unpopular with the
masses, but more so with the most popular sites.

I can see at least two ways to interpret this:

1\. nginx is just strictly better, and the sites at the top need that
performance/capability and employ the top/best-informed architects to maintain
their systems, so they're the early adopters. Everyone else is still on Apache
by virtue of inertia, but will slowly move over as time goes on.

2\. nginx is faster for high concurrency, and mostly gets used as a front-
lines layer in front of something else, maybe even Apache itself. In this
case, the charts will stay about like they are now, because only the most
stressed sites need that much engineering.

I don't know that there's an easy way to differentiate between the two without
either waiting and watching for change or knowing more about the internals of
the top few thousand sites.

~~~
kalleboo
I imagine a majority of small sites are still on cheap shared hosting
providers, and nginx doesn't support anything .htaccess which allows
individual site owners in a chroot jail to configure the web server.

------
runn1ng
I am a person that doesn't really understands webserver software. What is
approximately the difference between Apache and Nginx?

Also, should I stop using LAMP stack for my small and experimental PHP
websites that very few people visit, or is it good enough?

~~~
yuvadam
For small scale stuff, there's practically no difference between apache and
nginx.

For larger scale deployments, nginx is generally considered to perform better
than apache.

~~~
threeseed
Even for small scale stuff there are some benefits to using Nginx.

There is the ability to use Lua with MySQL, PostgreSQL, MemCache, Redis,
Upstream etc to perform functions of an app server e.g. authenticate users,
serve JSON from a database. It's fast and keeps your app layer focused on real
business logic.

~~~
sciurus
Not that nginx isn't great technology, but Apache has mod_lua too. Also,
mod_perl used to be very popular for embedding the kind of functionality you
talk about in the web server.

[https://httpd.apache.org/docs/current/mod/mod_lua.html](https://httpd.apache.org/docs/current/mod/mod_lua.html)

[http://modperlbook.org/](http://modperlbook.org/)

------
level09
A better title would be: "Nginx is the most used web server in front of other
servers"

------
eliben
Interesting - how can the trend seen in those charts be explained? The clearly
falling popularity of Apache the larger the website and clearly rising
popularity of Nginx complement each other nicely.

------
t0mislav
At work, we have Ngnix as reverse proxy for some static files. Oh boy is this
thing fast with very very small amount of resources (cpu, ram) and big number
of requests.

------
philliphaydon
I love nginx! I've almost finished a blog series of running Mono on nginx on
Ubuntu/Azure.

Awesome stuff!

~~~
adambard
If you're on Azure anyhow, why not use Windows and skip Mono? I don't have
personal experience with either, but I hear that Mono is still quite a bit
slower (although still fast enough for most purposes, I suppose).

------
flaktrak
And so it should! Apache is last millennium's technology.

------
dakimov
The open source continues to kill the industry burying the progress under
loads of free shit like that.

------
dschiptsov
This is just a PR and propaganda. We all know that JVM is the best "platform"
ever developed by humanity and Jetty is the most efficient, fast and
especially reliable under a high load web server.)

IIS must be on the second place, btw, considering how much man-hours and
millions of USD were spent on it. We all know that MS technology is superior
and very scientific.)

~~~
pestaa
I can't decide if you're serious or not, but if this is irony, it is very much
misplaced.

Nginx is rising because it deserves to, all others are more or less declining
because they fail to catch the attention of the average sysadmin.

~~~
dschiptsov
Nope. nginx is rising because it is a very masterpiece of programming. Take a
lock at the code - it is clean, readable, every syscall counted and thought
of. No unnecessary copying of data, not idiotic casting from one kind of a
data-structure to another. It is a piece of art of system programming. Look at
the code. Quality wins here.

~~~
eCa
I didn't chose nginx because of how the code looks. I doubt any program gets
any kind of mainstream attention because of that. (Of course, it is good that
the code is good.)

On the other hand, I use nginx as a reverse proxy in front of hypnotoad[1] so
I might be unusual..

[1]
[http://mojolicio.us/perldoc/Mojolicious/Guides/Cookbook#Hypn...](http://mojolicio.us/perldoc/Mojolicious/Guides/Cookbook#Hypnotoad)

