Since the beginning the Apache server, otherwise known as HTTPD, has been considered the absolute for all web services and even now host the majority of the internet. Then starting in 2004 new program showed up to take up the challenge of the C10K that even Apache could not conquer.
Nginx vs. Apache the conquest for delivering the Web and features to users across the internet.
The Apache server was the first viable alternative http server, in 1995 was built for better functionality and more performance then the competitor Netscape. Apache was a Open source community software with a prime focus for security and to distribute files to the ever growing internet users.
Apache grew in size to support PHP through the use of Mod_PHP, authentication, and Mod_Rewrite. Apache had an edge in those dark days the Internet by allowing virtual hosting and to this day still offers a lot of functionality. But This was back in the day that browsers were stupider, less open to change, and when shockwave was the original Flash application.
Apache is a multi threaded application but it cant use multi core computing. This leaves Apache with holes still to be filled butl because they added so much functionally to it there is only one thing apache can do and that’s suck up more memory. This drove the cost of hosting a website though the roof for much of the 1998 to 2007. Apache was one of limit to the growth of the internet. Apache for many years, has been considered the benchmark for server systems.
Nginx is the newest kid on the server farm with a variety of functions that comparable to Apache. Although both are open-source, Nginx has a genuine high-performance HTTP server and reverse proxy, as well as an IMAP/POP3 proxy server that balances with the use of an asynchronous event-driven approach to handling requests. What Apache lacked was the ability to address requests without threads or “Timers”. The Nginx servers are designed to specifically address the C10K problem without relying upon threads. Since its release in 2004, Nginx hosts roughly 7.5% of the domains worldwide taking in at 4th place of the internet servers. It delivers static content with the most efficient use of all system resources.
Nginx is more compatible with the future of the internet with its ability to fill the needs of various websites, which it serves as many as 500 million requests per day. Apache does not have that flexibility and runs redundant through stacks of unyielding spurious code. Plainly, Nginx has high performance, stable, rich feature sets, simple configurations, and very low resource consumption.
Where ever a programmer plans a project, Nginx's high-performance and small memory footprint allows it to scale in any direction. From the smallest VPS all the way up to clusters of servers Nginx powers the high-visibility sites, such as WordPress, Hulu, Github, Ohloh, and SourceForge.
Nginx uses exact names and wildcard names stored in hashes. The hashes are bound to the listen ports and every listen port can have up to three hashes: an exact names hash, a wildcard names hash starting with an asterisk, and a wildcard names hash ending with an asterisk. The size of the hashes are optimized at the configuration phase so that a name is referenced with the fewest CPU cache misses.
Nginx is the cutting edge of server load and low resource usage. It defines a new level of stability, absent in Apache systems. In April 2010, Netcraft reports that Nginx has served or proxies about 4.70% busiest sites in the world.
Simply put, Apache is less likely to define the most frequently requested names of a server and those references. Nginx efficiently defines the requests and handles them explicitly, creating a scalable event-driven (asynchronous) architecture. Nginx out powers, out maneuvers and leaves Apache in the dust.