Nginx Overtakes Microsoft As No. 2 Web Server 340
tsamsoniw writes "With financial backing from the likes of Michael Dell and other venture capitalists, open source upstart Nginx has edged out Microsoft IIS (Internet Information Server) to hold the title of second-most widely used Web server among all active websites. What's more, according to Netcraft's January 2012 Web Server Survey, Nginx over the past month has gained market share among all websites, whereas competitors Apache, Microsoft, and Google each lost share."
Re:market share v. reality (Score:5, Informative)
In my last job, we had a client with an all Windows environment. We're talking 2 DCs, a file server, an exchange server and a dedicated IIS server on the other side of the firewall and off the domain.
One day, they decided to revamp their static HTML website (this was a government department trying to justify their existence, IT wasn't exactly at the top of their list). We talked to the outfit doing it, who told us they were using PHP. Great, I though. We can get rid of an old and outdated Windows server and replace it with a nice, lean little Linux box. Nope, I was told to install the PHP ISAPI module on IIS, because "we were a Microsoft shop", even though this server was quite literally doing nothing but serving up HTML and chewing up an unnecessary Server 2k3 license. So after much fighting, and arguing to explain that we may as well NOT go through the trouble trying to set up and debug PHP as FastCGI, another guy went behind my back and stuffed up the install, leading to me wasting 3 or 4 hours rolling it back and installing it properly. Anyway, it's all smoothed over, until I get the zip file I've been promised by the "website makers". It was indeed a website, 10 or so DreamWeaver files with the extension renamed to PHP. No Drupal theme, no Joomla install, nothing. -.- God I hate the people in this industry that like to sell themselves as professionals
Great loadbalancer (Score:5, Informative)
Nginx is a great loadbalancer for http which makes it quite suited as a frontend and thus getting counted by netcraft . There could be hundreds of apache servers behind it . E.g. on my boxes Nginx runs as a reverse proxy in front of about 20 different apache, tomcat, more Nginx, other servers that generate some kind of html. But these 20 will all be counted as Nginx while they actually run something different. So I beleive it is quite hard to actually say what Server actually is the most popular.
Re:market share v. reality (Score:5, Informative)
There's some truth to this.
Several years ago, GoDaddy switch all of their domain parking to IIS, explicitly to get microsoft's numbers up. Throw 10,000 cnames pointed at a single machine serving up parking pages, and boom - 10,000 websites running IIS.
Re:Nginx is primarily a cache engine (Score:5, Informative)
Not always... for our Rails (and Sinatra) projects, we use nginx as the frontend/static asset server to a (pool of) Ruby-based application servers (mostly Unicorn). There's no Apache anywhere in the mix, and that has greatly reduced my migraines. Perhaps in some situation it makes sense to have nginx as a cache engine or load balancer for Apache, but in my world, nginx usually replaces Apache, rather than supplementing it.
Re:Great loadbalancer (Score:5, Informative)
Yep, it's mostly used for front-end duties like connection pooling, load balancing, SSL offloading, gzip, that type of thing. If you're running PHP stuff, it's still debatable whether you want to go FCGI or PDM instead of Apache's built-in module. There are ups and downs in both cases and you'll have to see what works best for your site. At my company we use Nginx up front (with server type obfuscated) for SSL offloading and gzip and connection pooling. From there it goes into a varnishd cache on the same server (stored in 100% RAM) which handles the static stuff. Varnishd then forwards remaining requests to an L7 load balancer appliance type thing which then drops requests to each of 10 web "application" servers which are a combination of Apache with mod_php, Tomcat and Jetty Java servers. We've also used Nginx as an IMAP proxy and cache and it works quite well for that.
Apache has a good architecture but it's horrible at handling a lot of simultaneous connections and recycling them (that will change in 2.4 but it's not out yet). Also, if you're using mod_php, over time each Apache process will take the total maximum amount of RAM your php process uses, and many of our PHP applications use 128-256M of RAM or more (data management type stuff). So you can run a server out of RAM if you're trying to maximize connections.
Nginx can handle 10K connections on a little box with very little RAM due to the way it threads stuff. It's basically a copy engine and it's very fast. Varnishd can also handle a lot of connections and can serve up content straight from RAM in less time than apache takes to build a connection. That being said, Apache is reliable, and has I feel better logging at the moment and just more of everything. It's a reference implementation. It's actually fine for most purposes but if you're handling 1000 users simultaneously and they are making 10-20 connections each with various service calls and static downloads, you gotta have something that can pool the conenctions on the front end and handle static content or you're going to spend a lot of money on RAM. And if you're serving up static content with Tomcat, Tomcat is absolutely garbage. I think it has to boot the whole JVM to serve up your one file. If not that bad, it's still awfully slow, and it REALLY benefits from caching up front. BTW, Nginx does caching as well but varnishd seemed more mature and elegant.
Now lastly, you can just go out and buy an F5 BigIP and it does all this stuff on specialized hardware (Ok, special board, intel chip) and it's out of the box. But even the little ones are $20K which is a lot of software dev hours and/or web server/database/storage hardware. Would be nice and fun to have but if you can't spend the money on hardware (and training!) the nginx/varnishd frontend is pretty much the best setup in my book at the moment. A little complex but once it's set up you just let it run. I made an internal nginx cache for all our internal sites, including some Java apps (e.g. Jira) and with requests going through the cache everything just flies. If you use sharepoint on IIS, you would be prettty stupid to not try a cache server up front, it's amazing. If nginx fixed mod_rewrite stuff to be the same as apache, it would probably be possible to make it into an application server, and we're going to get a test environment set up with php-fpm [php-fpm.org] and see how it fares. We'll see how managable it is though.
Re:Nginx is primarily a cache engine (Score:4, Informative)
The article and summary are misleading, typical slashdot. Typically nginx is used as a forward cache engine, often on the same box as apache. People typically put apache on port 81, and nginx on 80, and configure nginx to cache from port 81...
You do know there is something called mod_proxy for apache? Apache can be configured as a proxy or a web server. Nginx can be configured as a proxy or a web server. Your point is .. what, exactly?
I use nginx and I use it as a pure web server. I do not know what everyone else uses it for, but you can't just go about assuming whatever.
Re:market share v. reality (Score:5, Informative)
Actually www is fronted by reverse proxies running on linux (you can check with nmap). IIS apparently can't handle the load by itself.
And, hotmail took a long time to convert to M$. They tried once, then had a two week outage since M$ didn't scale worth a shit. They rolled back to Solaris, and kept it that way for a _long_ time.
Fun fact. Microsoft also used sendmail on sun boxes for internal mail for a long time after exchange was introduced. M$ couldn't get their own software to scale to an enterprise as large as their own.
Re:Quality (Score:5, Informative)
They're usually backend errors, nginx is often used as a reverse proxy.
Public internet sites.. (Score:4, Informative)
Re:IIS will become legacy software (Score:5, Informative)
Apache and nginx are both used for plenty of high traffic websites...
Not so long ago MS were also paying large domain registrars to host their parked sites (ie empty sites, but lots of them) on IIS to artificially inflate the netcraft stats.
Re:Quality (Score:5, Informative)
I don't use nginx, but:
By default, the Host header from the request is not forwarded, but is set based on the proxy_pass statement. To forward the requested Host header, it is necessary to use:
proxy_set_header Host $host;
I haven't heard of a web server which refuses to accept Host headers just because the client sends HTTP/1.0 instead of/1.1.
Re:Quality (Score:4, Informative)
I'd recommend HAProxy. It's twice as fast as Nginx is for load balancing, it's just as stable, and it supports more advanced balancing than simple round-robin.
Re:Quality (Score:4, Informative)
In my somewhat limited experience the place that nginx really shines is ssl.
I am prone to putting varnish on 80 and nginx on 443 with something heavy on the back end to spit out the dynamic content to the reverse proxies,
Re:IIS will become legacy software (Score:5, Informative)
IIS is used for industrial strength websites for corporations, online shopping sites, etc... People use IIS for _real work_, .
That is correct, but a lot more corporations use non IIS solutions for industrial strength web sites.
Re:IIS will become legacy software (Score:3, Informative)
Re:Quality (Score:4, Informative)
Most of the time you see a server error, it means that the web server is working but something else (often the database, more often the fastcgi or whatever) has failed. It's when you don't see any error that the web server itself is broken.
Since Apache 1.x is now officially unsupported, OpenBSD has imported nginx into the base system and it will be the included web server in a near future release. I've been using Lighttpd for a few years because it was lighter-weight and easier to configure. Development seems to have stalled in the past couple of years though, and nginx looks like a promising alternative.
Re:Finally! (Score:4, Informative)
No, MacOS X is a heavily modified MACH 3 os Microkernel, running a BSD server in Userland**.
The Server in userland may as well be BeOS, ReactOS, Haiku, or, for that matter, even WinNT.
So no, BSD is BSD, MACH is MACH, and MacOS X is Mach running a BSD Server in userland.
** A similar arrangement, and probably inspired by Mach is the "personalities" of WinNT (for those who rememeber there were the DOS personality, OS/2 Personality, Posix personality and Win 32 Personality).