Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Let's say you plan to host a few websites on your new VPS. Let's look at the tools you might need for each site. </p> <h2>HTTP Servers</h2> <p>Website 'Alpha' just consists of a some pure HTML, CSS and Javascript. The content is static. </p> <p>When someone visits website Alpha, their browser will issue an HTTP request. You have configured (via DNS and name server configuration) that request to be directed to the IP address of your VPS. Now you need your VPS to be able to accept that HTTP request, decide what to do with it, and issue a response that the visitor's browser can understand. You need an HTTP server, such as <strong>Apache httpd</strong> or <strong>NGINX</strong>, and let's say you do some research and eventually decide on NGINX. </p> <h2>Application Servers</h2> <p>Website 'Beta' is dynamic, written using the <strong>Django</strong> Web Framework.</p> <p><a href="http://en.wikipedia.org/wiki/Web_Server_Gateway_Interface" rel="noreferrer">WSGI is an protocol</a> that describes the interface between a Python application (the django app) and an application server. So what you need now is an WSGI app server, which will be able to understand web requests, make appropriate 'calls' to the application's various objects, and return the results. You have many options here, including <strong>gunicorn</strong> and <strong>uWSGI</strong>. Let's say you do some research and eventually decide on uWSGI. </p> <p>uWSGI can accept and handle HTTPS requests for static content as well, so if you wanted to you could have website Alpha served entirely by NGINX and website Beta served entirely by uWSGI. And that would be that. </p> <h2>Reverse Proxy Servers</h2> <p>But uWSGI has poor performance in dealing with static content, so you would rather use NGINX for static content like images, even on website Beta. But then something would have to distinguish between requests and send them to the right place. Is that possible?</p> <p>It turns out NGINX is not just an HTTP server but also a <a href="http://en.wikipedia.org/wiki/Reverse_proxy" rel="noreferrer">reverse proxy</a> server: it is capable of redirecting incoming requests to another place, like your uWSGI application server, or many other places, collecting the response(s) and sending them back to the original requester. Awesome! So you configure all incoming requests to go to NGINX, which will serve up static content or, when required, redirect it to the app server.</p> <h2>Load Balancing with multiple web servers</h2> <p>You are also hosting Website Gamma, which is a blog that is popular internationally and receives a ton of traffic. </p> <p>For Gamma you decide to set up multiple web servers. All incoming requests are going to your original VPS with NGINX, and you configure NGINX to redirect the request to one of several other web servers based in round-robin fashion, and return the response to the original requester.</p> <p><strong>HAProxy</strong> is web server that specializes in balancing loads for high traffic sites. In this case, you were able to use NGINX to handle traffic for site Gamma. In other scenarios, one may choose to set up a high-availability cluster: e.g., send all requests to a server like HAProxy, which intelligently redirects traffic to a cluster of nginx servers similar to your original VPS. </p> <h2>Cache Server</h2> <p>Website Gamma exceeded the capacity of your VPS due to the sheer volume of traffic. Let's say you instead hosted website Delta, and the reason your web server is unable to handle Delta is due to a popular feature that is very content-heavy. </p> <p>A cache server is able to understand what media content is being frequently requested and store this content differently, such that it can be more quickly served. This is achieved by reducing disk IO operations; the popular content can be stored in memory or virtual memory instead. You might decide to combine your existing NGINX stack with a technology like <strong>Varnish</strong> or <strong>Memchached</strong> to achieve this type of optimization and server website Gamma more effectively.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload