12 ms·
Nginx just became the most used web server among the top 1000 websites
- future_grad 13y agoStudent 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?
- dschiptsov 13y ago1. Look at the code. Especially src/core. 2. Nginx is a software pipeline, it has same ideas behind its design as modern CPUs. 3. Look at the code.
- future_grad 13y agoGreat advice. http://tomoconnor.eu/blogish/gwan-snakeoil-beware/ http://tomoconnor.eu/blogish/gwan-snakeoil-beware/ was a good read.
- dschiptsov 13y agoOh, I see - yet another MongoDB.)
- FooBarWidget 13y agoI know it's cool to say good things about Nginx, and Nginx is good software, but your point (2) doesn't mean anything. I'd like to see some serious research and explanation into Nginx's code. Full disclosure: I'm one of the authors behind the Phusion Passenger application server (https://www.phusionpassenger.com https://www.phusionpassenger.com), built on Nginx. What I'm saying here is based on my experience with Nginx module development and research into Nginx code. As far as I see, the main reason why Nginx is fast is because the programmer is brilliant. No, seriously. Look at the code. There are almost no comments, there are no unit tests, and yet Nginx has no well-known stability bugs, or even performance regressions. There are also tons of micro-optimizations, some of which are of questionable nature on modern CPUs (e.g. the huge switch statements in the HTTP parser). The Nginx code goes into great pain to ensure that there are no unnecessary copies or memory allocation. Everything assumes that you use static string structs that point to already-allocated memory instead of dynamically allocated strings. In return, writing an Nginx module requires extreme programmer discipline. Almost everything is hard. Compared to Apache, Nginx's main reason for being faster is because (1) it's evented and (2) it has a lot less features than Apache. No .htaccess - implementing .htaccess is a huge performance penalty because suddenly on every request you have to perform additional filesystem operations. No dynamic spawning of processes (unless you use Phusion Passenger). No dynamic loadable modules, so if you want to add anything you have to recompile Nginx entirely.
- dschiptsov 13y agoNginx is fast is because the programmer is brilliant. isn't it enough?) What I'm saying is that it is a good software. I don't even care that it was written by Russian guys. The code speaks for itself. As for praising, well, I had no intention to read the code very carefully, but what I been able to gather from it, it was well-designed before being written, and it evented nature - processing multiple requests at different stages in a single process, looks very much like a instruction pipeline of a modern CPU, at least to me. That's, probably, the reason behind its name - an engine.
- FooBarWidget 13y agoI don't really get the comparison with CPUs though. Pipelines, even software pipelines, have existed long before CPUs used them.
- axaxs 13y agoG-WAN is not open source, and has no peer source review that I know of. I was not even able to run the binary to test it due to my distro being too old. The self-made benchmarks cannot be taken at face value. If you dig deeper, you'll find outside benchmarks showing poor performance in other metrics. I don't mean to insult the author or product, just providing my 2 cents into its lack of popularity.
- deleted 13y ago[deleted]
- FooBarWidget 13y agoOther 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.
- future_grad 13y ago"I also cannot find any evidence of anybody using G-WAN in serious production." This. This. I find more articles about why NOT to use G-WAN more than anything.
- fredsted 13y ago>I've yet to see anybody claiming that G-WAN outperforms Nginx. What about this? http://nbonvin.wordpress.com/2011/03/24/serving-small-static-files-which-server-to-use/ http://nbonvin.wordpress.com/2011/03/24/serving-small-static... http://www.rootusers.com/web-server-performance-benchmark/ http://www.rootusers.com/web-server-performance-benchmark/
- jlgreco 13y ago> 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 13y agoSpeaking of losethos, the guy hasn't posted in twenty days, which is an hard break from his routine. I hope he's OK.
- xionon 13y agoFrom their website: "But G-WAN was written to have an application server, so it also supports 7 of the most popular scripted languages: Java, C#, C/C++, D and Objective-C/C++." As far as I can tell, G-WAN does not support the features or languages that many people want. As a Ruby programmer, G-WAN is (probably) impossible for me to use, and if I could fiddle with it enough to get it working, it would not provide enough of a benefit to justify replacing a working nginx setup. There's also the prevalence of tutorials, books, and StackOverflow answers related to nginx; G-WAN is pretty sparse in this regard. Basically: the eternal balancing act of "features" vs "speed." nginx hits a sweet spot for features & speed for more people than G-WAN.
- chc 13y agoNginx doesn't really support Ruby either. You need an app server, either compiled in like Passenger or one you proxy to like Unicorn. Is the second option not available here?
- simonz05 13y agoNever heard about G-wan before, but from a quick read-through it is not quiet standard. It seems like somewhat unusual design, but interesting. From the g-wan website: G-WAN is an all-in-one solution because communicating with other servers (FastCGI, SCGI, etc.) takes time (enlarging latency), and wastes CPU and RAM resources when the network can be avoided. Also, supporting many programming languages lets G-WAN serve most needs instead of having to use slower backend servers and fontend caches. Remember that our goal here is to use the ultimate low-latency and resource-saving solution. This is why G-WAN is a: -Web server -App. server -Cache server -Key-Value store server -Reverse-proxy and elastic load-balancer server
- rajivm 13y agoI'm not too familiar with G-WAN, but there's many more factors than some benchmarks published by the author of G-WAN: 1) G-WAN is closed source. This means you're tied to their paid support for fixes and improvements. Web servers are pretty critical pieces of infrastructure that are not replaced easily (if you're doing large deployments, custom config, etc.) and so having this risk is huge. 2) Documentation, configurability, support for well-tested integration with various application servers. For example, Nginx supports uWSGI out-of-box. The G-WAN site seems to have limited documentation. 3) Nginx is well proven in production. Sometimes just being incumbent is a good reason. This often takes some large project or company taking a risk on the platform, proving it in the process; this is unlikely due to #1. 4) Other benchmarks indicate otherwise in regards to G-WANs performance; not to say its bad, but the selection of benchmarks on its site is likely biased towards it. There may be many other reasons...
- simonw 13y agoI'd never heard of G-WAN. It looks like it isn't open source, which is a major turn-off these days for core infrastructure components like web servers.
- njharman 13y agoPerformance != Everything that is important.
- WatchDog 13y agoWhile we are on the subject of G-WAN, does anyone have any insight into the naming of the server. The only reference to "GWAN" I could find refers to a mysterious NSA system [1]. 1. http://en.wikipedia.org/wiki/File:Intel_GreenDoor.jpg http://en.wikipedia.org/wiki/File:Intel_GreenDoor.jpg
- dschiptsov 13y agoThis 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 13y agoI 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.
- amackera 13y agoI think it was meant tongue-in-cheek.
- dschiptsov 13y agoNope. 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 13y agoI 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#Hypnotoad http://mojolicio.us/perldoc/Mojolicious/Guides/Cookbook#Hypn...
- threeseed 13y agoI know you were joking but actually in those web benchmarks that have been posted some of the JVM frameworks actually beat the Nginx based one (OpenResty).
- jstanley 13y agoIt 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_on_the_top_10_million_sites http://w3techs.com/blog/entry/w3techs_surveys_are_now_based_... implies they are using Alexa's rankings.
- nkozyra 13y agoI wonder how much of this is actually a reverse proxy to apache, though.
- zaphoyd 13y agoI wonder this as well, especially with "top" websites. How much high profile traffic these days is actually served by a single piece of software? All of our high profile sites have layers of caching and load balancing between them and the Apache backends that actually generate the content. In our case Nginx is in fact on the public facing end performing reverse proxy and TLS termination only. That is not to say Nginx isn't a fantastic product, but it may not be entirely fair to Apache, Varnish, and friends to measure HTTP server marketshare in this way.
- ownagefool 13y agoIt's likely a significant number still do this for legacy reasons but for new deploys utilising the likes of PHP-FPM, PSGI, uWSGI, & Rack should allow you to avoid using apache at all.
- machbio 13y agoA 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 13y agoNginx 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.
- aidenn0 13y agoA lot of php projects us apache specific dot-files in the php directories though which makes Apache more turnkey for using those.
- runn1ng 13y agoI 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?
- metachris 13y agoFor me the main reasons to switch from Apache to Nginx were that it's smaller, faster, very flexible and easier to configure. Plus the additional features (eg. reverse proxy, ...).
- sciurus 13y agoHuh? Apache has been able to act as a reverse proxy since the 1990s. See https://httpd.apache.org/docs/current/mod/mod_proxy.html https://httpd.apache.org/docs/current/mod/mod_proxy.html There's a list of all the official Apache modules at https://httpd.apache.org/docs/current/mod/ https://httpd.apache.org/docs/current/mod/. Also, there are many third party modules.
- stephenr 13y ago"Reverse proxy" is not an "additional feature" of nginx. Apache can serve as a reverse proxy to a web server, or even a fully functional forward proxy for lan users to the internet. Nginx was never meant to have more features than Apache, it's intended to be lightweight and fast. If you can imagine it, Apache is likely to have a module for it. With nginx, not so much.
- ameswarb 13y agoApache is a process- and thread-driven application, but Nginx is event-driven. The practical effect of this design difference is that a small number of Nginx "worker" processes can plow through enormous stacks of requests without waiting on each other and without synchronizing; they just "close their eyes" and eat the proverbial elephant as fast as they can, one bite at a time. Apache, by contrast, approaches large numbers of requests by spinning off more processes to handle them, typically consuming a lot of RAM as it does so. Apache looks at the elephant and thinks about how big it is as it tucks into its meal, and sometimes Apache gets a little anxious about the size of its repast. Nginx, on the other hand, just starts chomping. The difference is summed up succinctly in a quote by Chris Lea on the Why Use Nginx? page: "Apache is like Microsoft Word, it has a million options but you only need six. Nginx does those six things, and it does five of them 50 times faster than Apache." Source: http://arstechnica.com/business/2011/11/a-faster-web-server-ripping-out-apache-for-nginx/ http://arstechnica.com/business/2011/11/a-faster-web-server-...
- SideburnsOfDoom 13y agoIt'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 13y agoSame 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.
- babuskov 13y agoThere 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.
- kilovoltaire 13y agoJust in case you didn't notice, the graph also includes "top 1,000,000" websites, and the percentages are indeed quite different.
- TallboyOne 13y agoProbably because of the 10 trillion $1/month cpanel accounts
- singlow 13y agoNo 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.
- jtchang 13y agoI 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 13y agoI've always found it interesting that of the major Web servers IIS is the only one with a programmatic configuration API.
- eblume 13y agoI have never configured an IIS server. Do you find that the programmatic configuration API is helpful? I rarely find httpd.conf or nginx.conf to be difficult to manage, but it's possible that we're missing out on a good thing in the OSS world. It's been known to happen.
- sjwright 13y agoI built a system that generated IIS configuration XML files, and a script to apply/import them on any/all servers in an array. It worked, and was substantially better than using the supplied GUI, but still inferior to editing nginx conf files by hand. These days I wouldn't touch IIS with a [very long object].
- philliphaydon 13y agoIIS 7.5 / 8 is pretty good. Some cool features in 8. Anything below 7.5 I hope I never have to touch again...
- stephengillie 13y agoInstead of killing worker processes that exceed the CPU throttle, like in IIS 7, those processes are simply throttled in IIS 8.
- philliphaydon 13y agoI love nginx! I've almost finished a blog series of running Mono on nginx on Ubuntu/Azure. Awesome stuff!
- adambard 13y agoIf 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).
- GeneralMayhem 13y agoAlso 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 13y agoI 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.
- dakimov 13y agoThe open source continues to kill the industry burying the progress under loads of free shit like that.
- t0mislav 13y agoAt 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.
- mike-cardwell 13y agoAnd 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-server-survey.html http://news.netcraft.com/archives/2013/07/02/july-2013-web-s...
- mstrem 13y agoJust 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.
- eliben 13y agoInteresting - 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.
- flaktrak 13y agoAnd so it should! Apache is last millennium's technology.
- level09 13y agoA better title would be: "Nginx is the most used web server in front of other servers"