Boosting the application concurrency

Most of the time when we are building some web application through a framework, the frameworks usually provide a small and easy to run web server. Although these servers are good for use in the development environment to quickly realize the changes and debug through the issues inside the application during the development stage, these servers are not capable of handling the production workloads.

Even in the case when the whole application has been developed from scratch, it is generally a good idea to proxy the communication to the web application through use of a reverse proxy. But the question arises is, why do we need to do so? Why shouldn't we just run the web application directly and let it handle the incoming requests. Let's quickly go through all the responsibilities the web application serves:

  • Handling of incoming requests: When a new request arrives at the web application, the web application might need to decide what to do with that request. If the web application has workers that can process the request, the application will accept the request, hand it over to a worker, and return the response for the request, once the worker finishes processing. If there is no worker, then the web application has to queue this request for later processing. In the worst case, when the queue backlog has exceeded the threshold of the maximum number of queued clients, then the web application has to reject the request.
  • Serving static resources: If the web application needs to generate dynamic HTML pages, it may also double up as a server to send across the static resources such as CSS, Javascript, images, and so on, hence increasing the load.
  • Handling encryption: Most of the web applications now come up with the encryption turned on. In this case, our web application will also require us to manage the parsing of the encrypted data and provide a secure connection.

Those are quite some responsibilities to be handled by a simple web application server. What we rather need is a mechanism through which we can offload quite a lot of these responsibilities from the web application server and let it handle only the essential work that it is supposed to do and where it really shines.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.139.240.244