Nginx – Another HTTP Server

                         nginx

                              In this article let us discuss the Nginx(pronunced as engine-x) web server. From late 95’s Apache is the prominent web server in the web industry and most of the websites are using till today. We will see that is the bottleneck with Apache on heavy load with high concurrency. The latest Apache uses either pre fork method or worker multi-process mode (MPM). In both the cases when the client sends request the Apache will create additional processes/threads to process the request. When a process or thread gets spawned, there is a load on the hardware where it utilizes the CPU and RAM. During the heavier loads the resources availability will get drained and hence Apache won’t accept any new requests/the processing of requests will get slows down.

                              Nginx says it addresses the C10K problem which is highlighted in the paper. Unlike other web servers Nginx doesn’t use  more processes and threads to handle the requests. Nginx adopted the “event-driven and asynchronous” architecture. Nginx won’t create new processes for each web request, instead it will create worker processes for the main Nginx process. Each of these processes is single-threaded. Each worker can handle thousands of concurrent connections. It does this asynchronously with one thread, rather than using multi-threaded programming. The below simple diagram depicts the way Nginx processes the client requests with minimal usage of system resources.

Nginx

                                    Nginx addresses the high scalability and high concurrency problem hence most of the high traffic sites are using. For example  Netflix, Hulu, Pinterest, Airbnb, WordPress.com, GitHub, SoundCloud, Zynga, Eventbrite, Zappos etc…

In the coming articles will see how we can configure Nginx as load balancer. Until then, Happy Learning !!!

Advertisements

I am Siva Prasad Rao Janapati. Working as a software developer. Has hands on experience on ATG Commerce(DAS/DPS/DCS), Mozu commerce, Broadleaf Commerce, Java, JEE, Spring, Play, JPA, Hibernate, Velocity, JMS, Jboss, Weblogic,Tomcat, Jetty, Apache, Apache Solr, Spring Batch, JQuery, NodeJS, SOAP, REST, MySQL, Oracle, Mongo DB, Memcached, HazelCast, Git, SVN, CVS, Ant, Maven, Gradle, Amazon Web services, Rackspace, Quartz, JMeter, Junit, Open NLP, Facebook Graph,Twitter4J, YouTube Gdata, Bazzarvoice,Yotpo, 4-Tell, Alatest, Shopzilla, Linkshare. I have hands on experience on open sources and commercial technologies.

Tagged with: , , ,
Posted in Nginx

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

DZone

DZone MVB

Java Code Geeks
Java Code Geeks
%d bloggers like this: