Scroll to top

Apache or NginX that You Should Use ?


Real Novice - 29 July, 2018 - 0 comments

Sharing is caring!

Apache or NginX that you should use for your server will be our topic on my second post in the Novicearea.com . If you want or already develop an app that will be deployed on a server like VPS or Dedicated Server then you should decide to use a web server that will suit with your web apps. There a many of web server programs which are free / open source or paid just like Apache, NginX, IIS,Caddy, Hiawatha, Lighttpd, and many more that may you never hear as some of people or company sometimes using their own developed web server program.

Apache or NginX

Apache or NginX

In this section we will talk about Apache and NginX as the Free and Open Source web server program that handle and dominating about more than 50% of the internet traffic all around the world. Both of Apache and NginX are really compatible with many and almost of the internet system stack technology such as hypertext preprocessor (php), Perl, Phyiiiiton, etc. Then which one should be used, Apache or NginX ? . To answer this question, it depends on the conditions of your app or system that you want to be deployed. Well then, before we are going to the main comparison and conclusion let we see the short history of each program.

Apache development started on 1995 by Robert McCool and started raising his popularity since 1996 and continuously developed under Apache Software Foundation since 1999. Many of webserver panel used it as the default web server program such as CPanel. Apache is really easy to configure and compatible with almost of CMS (Content Management System) like WordPress, Joomla, Drupal, etc which you just need to run your apps with easy configuration. Apache uses Forked Threaded Keep Alive Solution that maintain open connection to the users that connect to the server. Since then, Apache known as the good web server to serve dynamic content of the website or apps.

apache web server

apache web server

 

Nginx project started on 2002 by Russian Software Engineer Igor Sysoev as the project to solve C10k problem for web servers to handle more than 10.000 connection at the same time. Then it released to public on 2004 to comply the purpose of asynchronous architecture , non-blocking event loop and event driven. Nginx process are very light on the minimum hardware resources that give an amazing performance to serve static content. With this condition, Nginx also have load balancing system that make you could deliver your content faster if you have more than one server.

Nginx Scheme

Nginx Scheme

Well ya, now we will make comparison between Apache and Nginx based on how each of them when handling the connections and from how each of them handling and delivering the contents both of static and dynamic. And then let we see the differences.

Connection Handling, Apache using the MPM Technology (Multi Processing Module) to handle every connection that come to the server and its really have flexibility to handle the connections. MPM is good to serve congruent connections as long as the system has enough resources. If the system has not enough resources, then it will make the apache performance going to down. On the other side, Nginx is released after apache and Nginx really know about this problem (I mean apache with her MPM when she has too many connections at the same time). Nginx using “Asynchronous events driven” that really capable to handle many connections at the same time with limited resources on the server. You won’t need a very high resources server like apache when using Nginx to handle more connections, but when you have a first class server with a good resources and not too much connections there would be better to use apache .

Static and Dynamic Content Delivering, if we talk about content delivering from a server to the clients that request the contents, there are two mechanism types to serve the web contents. The first is SPA ( Single Page Application) and the Second is MPA (Multi Page Application). And from many benchmark that has been held to compare between apache and Nginx give us the result that Nginx is 2.5X better than apache when serving static content when the connections comes up to more than 1000 connections at the same time, and the Apache has a good point in her result when serving dynamic content than Nginx (although some benchmark states that Nginx have nearly same point with apache , but most of the benchmark told that apache is more better than NginX to server dynamic contents).

Oh nice. Now we know the most point to choose between Apache and NginX to be used on our server. The conclusion is if you want to build a server to serve a dynamic content you better to choose apache as your web server application, then if you want to server static contents and handle many connections at the same times then it comes to be NginX as the better choice. But how if you want to serve dynamic content with more connections?, well ya for this question you could use Apache and NginX at the same time where apache processing the dynamic content and after the application has been processed it comes to NginX to work to serve the processed content by apache to the clients. This technology is now become popular and well has been implemented on some web server panel whether its free or commercial ( I took VestaCP as the free web server panel with this technology).

Colaboration of Apache and NginX

Colaboration of Apache and NginX

 

For people that really novice (I mean new in web server configuration) then it’s better to use apache, because apache is well documented and more easy in configuration plus almost compatible with many web server add on. On NginX you need some knowledge and time to make a configuration to install some scripts or CMS such as wordpress (so you need to be patient to get the wordpress work on your pure NginX web server).

OK, thank you very much for visit to my blogs. Let we elevate our knowledge together to break the limit and to be a pro. Don’t miss on my next post and just bookmark us.

Related posts

== ==
shares