
Nginx reaches 33.3% web server market share while Apache falls below 50% - MarionG
https://w3techs.com/blog/entry/nginx_reaches_33_3_percent_web_server_market_share_while_apache_falls_below_50_percent
======
p49k
This is kind of a weird statistic to try to analyze. So many uses of nginx are
just the act of putting an Apache/IIS/etc site behind nginx, so technically,
both servers still have market share but you only see nginx. It's just that
nginx makes it so easy to do certain things, like supporting modern HTTPS,
that you might as well add it to your stack rather than replace something.

~~~
ag_47
As someone younger who never really used Apache, I don't see any reason to do
anything with it instead of Nginx. Other than supporting "legacy" setups,
whats the point of Nginx load balancing Apache? Configuring nginx is just so
much more intuitive.

~~~
smsm42
nginx is much more simple than full-service servers like Apache. Which is good
if you want to do something easy fast (like terminate TLS, proxy, load-
balance, simple redirect, simple header munging, etc.). And not good if you
want to do something more complex and get into learning how nginx rewrite
rules _really_ work (totally not obvious), how if and other predicates
_really_ work (multiple articles in docs suggest it's not obvious at all) and
what limitations are needed to achieve the simplicity and quickness. So if you
want your webserver to do something complex, you'd go for Apache. But may
still put nginx in front for LB, static content, pre-cache TLS, etc.

~~~
user5994461
A good reason to use nginx (or better HAProxy), is to stop people from writing
endless mess of redirect and rewrite rules.

~~~
smsm42
Not many people do it just for fun. Stopping people from doing what they need
to achieve job being done is usually not the most productive idea.

~~~
user5994461
There are very few justified usages that require to write maze of rewrite
rules.

Most people do it because they have no idea what they are doing and they never
decided on a naming convention for their apps and domains.

~~~
Something1234
What are some justified uses of rewrite rules?

~~~
tyingq
Making broken links pointing at your site work (301), without breaking links
to the correct URL.

Especially links on sites you have no control over.

------
shanemhansen
Apache has historically been a giant swiss army knife that will do just about
everything you could want, from redirect databases to cgi to php interpreters
to crazy auth setups. It did all that while still being a reasonably good
workhorse for static file serving (when properly turned and using the right
worker model, event rather than threaded or process).

Nginx seems to have a different model. It does support a number of features
but from what I can see it focuses on composing functionality with HTTP rather
than adding more plugins.

Nginx seems to do a great job at being a load balancer and cdn-lite, and it
seems like that's what the market wants out of a web server.

~~~
rgacote
nginx is turning into much more than just a load balancer. Projects such as
OpenResty (a full CMS built into nginx) and Kong (an API management service),
are built right into nginx using Lua. We've done some minor nginx Lua
extensions and are looking to offload activities such as JSON validation into
the front-end nginx.

[http://openresty.org/](http://openresty.org/)
[https://getkong.org](https://getkong.org)

~~~
hdhzy
By JSON validation do you mean just checking if it's well formed or rather
something like JSON Schema validation?

The latter seems tricky. It's validation inside the application a bottleneck?

~~~
rgacote
Yes, json validation against schema. Bigger picture, in future we're looking
to do some upstream proxy redirects based on payload. Figured the first step
is short-circuiting anyone not sending us valid json. Plus, back ends are
written in a variety of languages -- not all of whom do json schema validation
nicely.

------
jstanley
Netcraft's web server survey shows nginx at only 20%, and shows Apache
dropping below 50% way back in August 2013. That's a big difference compared
to w3techs and both sources should be taken with a pinch of salt.

It's the 3rd chart on:
[https://news.netcraft.com/archives/2017/03/24/march-2017-web...](https://news.netcraft.com/archives/2017/03/24/march-2017-web-
server-survey.html)

Web server market share depends a lot on which sites you're looking at: are
you checking the top X million sites or checking every site you can possibly
find out about? And also how you're deduplicating them: is every blogspot blog
counted separately?

Disclaimer: I work at Netcraft (but not on the survey).

~~~
jnordwick
So, literally, Netcraft confirms Apache is dying.

~~~
smsm42
For "dying" being defined as "increases installs but slower than the whole
market balloons".

~~~
user5994461
"while only powering about half the world"

------
jimjag
nginx is creating a name and market for itself as a reverse proxy, even though
there are better solutions for reverse-proxies out there, everything from
HAProxy to Apache Traffic Server to even Apache httpd. But this is an
important market to have. Why? Because it allows for the perception that the
"web runs on nginx" simply because all you see are the nginx web proxies and
nothing behind that.

So what are the servers behind nginx? 9 times out of 10 it is Apache httpd,
and numerous instances of it at that. So for each single nginx server "seen"
in these surveys, there are unknown _multiples_ of Apache httpd behind the
scenes doing the real work.

But all that messes up the popular, if incorrect, narrative that Apache httpd
is dying and nginx is gobbling up instances. It's all about marketing baby,
for a product that really isn't truly "open source" but more so open core. And
people buy it hook, line, and sinker.

~~~
vfaronov
> _So what are the servers behind nginx? 9 times out of 10 it is Apache httpd,
> and numerous instances of it at that._

Can you cite a source for this?

In my practice, the servers behind nginx are usually platform-specific
application servers, such as Gunicorn or uWSGI for Python.

~~~
snowwrestler
I think the idea is that if you count every single website on the web, a huge
number of them are crappy little sites on shared hosting. Shared hosting
usually relies on .htaccess rules, which are only valid under Apache.

Popular PHP CMS software also relies on .htaccess. Wordpress for example
allegedly powers about a quarter of all websites, and auto-creates an
.htaccess file when you enable pretty links, which basically everyone does.
Drupal ships with multiple .htaccess files.

Sure it's possible to adapt this code into Nginx configuration, but there is
really no reason to do that. It's far easier to set up Nginx in front of
Apache and get most of the Nginx benefits that way.

------
Nux
A lot of Apache work load is now behind Nginx or Haproxy, I wouldn't say those
numbers are entirely truthful.

Consider how Plesk panels nowadays go with Nginx proxy by default, but Apache
in the backend; CPanel will probably follow soon and people have already been
doing this manually for a while too.

Apache is still there, just not in as much plain sight as it used to.

~~~
mrweasel
That's certainly true for us, everything is just put behind a pair of Brocade
Traffic Managers. I really do like, and to some extend prefer Nginx, but we're
perhaps 20 different people servicing different customers so we standardised
on Apache, because it support everything, and the traffic managers deal with
performance.

People like to think they are special, and that they've need more speed, so
they turn to Nginx, but most of us can easily be served by Apache.

------
jimjag
How much of nginx's growth is, do you think, due to it being "better" than
Apache httpd (which it isn't, BTW. Apache 2.4 is easily as fast and scalable
as nginx), compared to either (1) The aggressive sales and marketing of NGINX
the company or (2) nginx fronting Apache httpd and thus "hiding" the growth of
Apache httpd usage. But there are lots of Apache httpd haters, for some
reason, and so they LOVE promoting the FUD. And yeah, I am an admitted Apache
fanboy so feel free to ignore my viewpoint if it shatters your world-view :)

~~~
CalRobert
I started needing to configure web stuff about 6 or 7 years ago. At the time,
I could use nginx or Apache. I spent a bit of time (maybe 20 minutes) with
Apache since I'd heard of it, thought "Ugh this is a pain and I just want to
move on to the fun parts of this project and not banal config details", and
then tried nginx. It was much easier, and I've never bothered to learn Apache.
To be honest I've kind of assumed it wasn't worth learning since it seems to
be in slow, but persistent, decline, and I've never needed to learn it for a
particular project.

I wonder if anyone else had a similar experience. If the first 20 minutes are
nicer with one tool over the other, I suspect most people will stick with that
tool until it starts limiting them.

I don't think any of the stuff you mention is related to that.

~~~
GlennS
I've had the experience in the reverse order, but with the same conclusion.

First lot of web server configuration I had to do was Tomcat. After that, IIS
6 through to 8.

Compared to any of those those, writing Apache httpd config actually seems
pretty straightforward.

But yeah, Nginx is a lot plainer and I pick it most of the time. Usual time
when I don't is if deploying someone else's software with complicated rules
and don't have the time to port them.

Damn Tomcat config is godawful gibberish. Seems to be a running theme in
Javaland.

------
boznz
Can also be re-written as "Apache Still the dominant web platform for the
internet despite the upstarts.."

I Don't consciously know either server, I just like the way sites can spin
facts differently.

~~~
pthreads
>Can also be re-written as "Apache Still the dominant web platform for the
internet despite the upstarts.."

No, it can't. That just misses the entire point of the article. The key take
away from it is how much Nginx has grown in the last few years by taking share
away from Apache especially those deployments that needed support of modern
protocols (from the article: 76.8% of all sites supporting HTTP/2 use Nginx,
while only 2.3% of those sites rely on Apache). All the others have barely
made a dent.

Also read the distribution of how Nginx fares vs. Apache among the top
websites. It gives a much better picture of what is happening.

>I Don't consciously know either server, I just like the way sites can spin
facts differently.

Well then you really can't make the statement that it is a spin, can you?

~~~
cdubzzz
I assume boznz meant an entire (different) article could be written with that
headline. One can certainly call this or the theoretical opposite article
spin.

~~~
Dylan16807
You could maybe write three sentences on "still a lot of Apache". It's the
changes that you need to learn about.

~~~
cdubzzz
_I_ could certainly write a lot more than that on the topic, as could any
decent writer. What one needs to learn about and one writes about is not
necessarily the same thing. Again, I think the original comment here was more
of a general statement about the manipulability of statistical analysis
"articles".

~~~
Dylan16807
You can write an article about anything in the world. But when it comes to
statistical analysis then in a pretty objective sense there is only one
interesting thing to say about this data. Despite theoretical ability to be
manipulative, only one of these two angles qualifies as news.

------
jwildeboer
Or: 83.3% of web servers are Open Source. How does that sound? :-)

------
Neil44
I saw a recent version of cPanel that used ngnix as a proxy in front of
Apache, with Apache on a high port. That might be responsible for a lot of the
new ngnix seen out there.

~~~
ollybee
cPanel has no native support for nginx, if you've seen that it's been using a
third party plugin. The second most popluar server controlpanel Plesk supports
the configuraion you describes bt it's not enabled by default so I doubt will
be affected the statistics.

------
oblio
IIS will probably continue its nose dive as Microsoft pushes forward with .NET
Core. I'm guessing people using .NET Core are more likely to use Kestrel +
Nginx as a proxy.

~~~
insulanian
Yes

------
patrickmn
Nginx is the web server equivalent of programming languages with fibers (in a
good way.)

Is there anything that competes/a "next Nginx"?

~~~
gmazza
[https://caddyserver.com/](https://caddyserver.com/)

Caddy is written in Go, and make use of native fibers/green
threads/goroutines.

~~~
problems
Also has builtin letsencrypt automation and generally easier configuration, so
for small sites it might be a better option than nginx.

~~~
reitanqild
I think their docs says that unless you expect to scale to multiple x 10 000
requests / second then it caddy might be worth trying.

I went with it for the test networks at my job and liked it a lot.

~~~
SmellTheGlove
And then when you do, you can use Nginx to reverse proxy N Caddy instances!

------
njharman
Huh, I'm surprised Apache is still so high? Are there huge hosting sites that
use it or something? Wordpress?

I (and I know no one) who has reached for Apache over NGINX in a decade.

~~~
cookiecaper
Apache has served my purposes fine. I've used nginx in some cases, mostly when
it was already configured, but I personally have not yet found a strong reason
to prefer one over the other (and I would suggest that this is probably
another case of overblown hype, and that Apache probably continues to work
perfectly fine for most use cases).

I mostly continue to use Apache because I'm more familiar with its syntax, but
it sounds like nginx is popular for use cases that we've just used purpose-fit
applications like haproxy to fill.

------
astrostl
Come for the performance promises, stay for the configuration.

------
wyqydsyq
"Just to put that growth rate in perspective: this is 70 times the number of
sites that switch to Node.js, another fast-growing web server."

I find it hard to believe this could be accurate considering the vast majority
of Node.js deployments are also utilizing Nginx as a reverse-proxy in front of
it. I think a large portion of nginx's uptake is actually due to Node.js'
popularity.

~~~
CalRobert
Yeah - I think "put this behind nginx" is pretty standard practice for nodejs
projects. I mean, even for relative beginners, advice like this is common (and
sound)

[https://www.digitalocean.com/community/tutorials/how-to-
host...](https://www.digitalocean.com/community/tutorials/how-to-host-ghost-
with-nginx-on-digitalocean)

------
agentPrefect
So I reckon Docker & PHP7/HHVM have contributed for sure. So much easier
deploying Nginx - not to mention just plain nicer.

~~~
jimjag
Shame that Apache httpd 2.4 w/ HHVM is actually fastest:
[https://www.youtube.com/watch?v=JNbKJ22DS10](https://www.youtube.com/watch?v=JNbKJ22DS10)

------
petters
Another measurement put Google at 13% in 2010.
[https://m.theregister.co.uk/2010/01/29/google_web_server/](https://m.theregister.co.uk/2010/01/29/google_web_server/)

Also, by amount of traffic it's another story (YouTube).

------
tigershark
I am really surprised no one brought on the performance topic. Now I have been
out of web programming for half a decade or more, but if my memory is not
completely gone I remember that nginx was about an order of magnitude faster
than apache under heavy load. Is it still the same nowadays?

------
ramijames
I run apache locally for development and nginx on my servers. I much prefer
setting up nginx.

------
nirav72
Looks like Nginx has the highest usage in Russia. Why is that?

~~~
tyingq
Creator of nginx is Russian. Which probably means good word of mouth
marketing, good docs in their language, etc.

~~~
emanreus
If I'm not mistaken he created it while working at/for rambler.ru which is one
of the biggest Russian websites (it was serving 500 million requests per day
at that time).

------
edpichler
This is like (or worst) than comparing orange and apples. Nginx and Apache are
completely different.

~~~
njharman
Yeah highly configurable, full-featured http(s) servers expandable with
modules are TOTALLY different.

~~~
edpichler
But can Apache, natively, also be used as a reverse proxy, load balancer and
HTTP cache? If yes, I am sorry about my wrong comment.

~~~
jimjag
Yes it can.

------
keymone
Calling it. Nginx won because it's configs are not xml. Apache should have
learned by now.

~~~
mrweasel
XML should NEVER be used for configuration, not even if you're a Java or C#
framework/middleware/application server.

~~~
zeveb
Honestly, I think the statement, 'XML should NEVER be used, period,' is true
as well: for any use case I can imagine there are superior alternatives to
XML. Even if you have to interface with other services using XML, just use
SXML
([https://en.wikipedia.org/wiki/SXML](https://en.wikipedia.org/wiki/SXML)) in
your own code and marshal to XML at the very last instant.

Ultimately, XML was a colossal mistake carried out to perfection.

~~~
mi100hael
I've never seen SXML before, but that looks way worse. All of Lisp's
frustration of trying to match closing parens with none of Lisp's power.

~~~
mixedCase
As opposed to closing tags? All decent text editors have matching parens
highlighting.

SXML is much easier to parse and it's more concise.

~~~
tannhaeuser
HTML _itself_ allows SGML-style tag omission since HTML was originally an
application of SGML. A simple example can be found at [1], and can also be
seen in action in my talk slides linked from [2].

[1] [http://sgmljs.net/docs/html5.html#tag-omission-on-
document-l...](http://sgmljs.net/docs/html5.html#tag-omission-on-document-
level-elements)

[2]
[http://sgmljs.net/blog/blog1701.html](http://sgmljs.net/blog/blog1701.html)

~~~
mixedCase
We're talking XML rather than HTML (and omitting certain closing tags isn't
compliant HTML5 anyway).

In XML there's also the concept of using self-closing tags only for "empty
tags". Meaning, <tagname val="123"/> isn't "correct" and
<tagname>123</tagname> should be used instead; while s-expressions simplify
this.

~~~
tannhaeuser
Sorry but your comment re XML is incorrect. I suggest you study the HTML and
XML specs, especially if want to convince us of an alternate XML
serialization.

