The Web Accelerator

What is the Web Accelerator?

The Web Accelerator is a custom load-balancer with a built-in cache system powered by Varnish, created by Gandi for its Hosting platforms. We use it to manage all the requests on Simple Hosting, achieving low latencies and fast content delivery. You can use it yourself on the IaaS platform to cache and/or load-balance requests between multiple servers to handle more concurrent visitors.

Speed up the loading of your websites

A Web Accelerator is used to minimize the response time of your website and optimize the flow management of multiple simultaneous connections.

How does it work?

  • it takes over the client connection management and data flow from the web server
  • it negotiates and generates the SSL encryption (https)

This has the effect of speeding up the response and load time for all website visitors. The accelerator is located ahead of one or multiple web servers, and will take charge of the HTTP requests usually sent to the web server(s). Once requested and loaded in the cache, data is remembered and can be retrieved with greater speed when requested a second time.

The direct benefits are shorter resolution times and a better distribution of your resources: while your cache manages the recurring requests, your server´s capacity is fully available for more critical tasks while the cached objects haven't expired. You can also use more than one server to handle the requests, allowing you to scale horizontally.

You can also easily use a SSL certificate with your Web Accelerator, to encrypt and secure exchanges with your website. Hardly any additional configuration is necessary on your end. All you need to do is to adjust a few settings on your Gandi interface.

Balance HTTP load over multiple servers with Round robin or Client-ip

Another interesting feature of the Web Accelerator is it's ability to distribute the traffic load across multiple servers (this is also called a load balancer configuration). As the name implies, the Web Accelerator works only with HTTP, so only web traffic can be balanced with this feature. It is nonetheless quite useful, and can be configured with a few clicks. Changes take effect almost immediately (your zone file remain unchanged, so there is no need to wait for DNS propagation time).

You have the choice between two load balancer algorithms:

  • round-robin = all requests are randomly sent to the various connected web servers. The downside is that this can interfere with the session tracking process.
  • client-ip : When a server is selected to serve a client, all requests are sent to the same server until the session is closed.

If your websites require login, or use sessions to run your web applications, then we recommend the client-ip algoritm to avoid potential conflicts with your application.

It is also possible to add a Healthcheck sensor, to check the availablility of each web server. If a server is no longer responding, the Web Accelerator will stop sending requests to it. This adds redundancy to the site.

How to create a Web Accelerator

The creation is pretty simple: Go to the section called “Servers” in your Gandi interface and click on “Web Accelerator”. Only two pieces of information are required: the name and the location. The accelerator needs to be in the same data center as the servers it connects to.

How to declare addresses

You can declare an address on a Web Accelerator directly on your Web Accelerator administration page: click on “Add an address”. Enter the website address and click on “Submit”.

If your domain is registered with Gandi and you use Gandi's DNS, then you will have to opportunity to request automatic adjustment of your zone file during the new address creation process.

In the event that your domain is not registered with Gandi, or if you do not use Gandi's DNS, you will need to add a TXT record in your zone file or link a text file to the concerned address.

You will be supplied with the necessary TXT record in your Gandi interface.

Add a SSL certificate to an address

If you would like to use an SSL certificate for a declared address, click on the padlock icon located on the right hand side of the virtual host. Fill in your private key and add the certificate. Do not forget to validate the operation.

You can see a list of supported certificates for Simple hosting on this page.

Add a new server

Once you have associated the address(es) to the Web Accelerator, set up the web servers, which will host your websites. On the administration page of the Web Accelerator go to “Network Interfaces” and click on “Add a network interface”. Chose the right server from the dropdown list and indicate the port as shown below :

Please make sure that your virtual host (website address) is correctly declared on your web server. For Gandi AI servers, the port number is 80.

Feel free to chose between the two available load balancer algorithms and modify your set up to accommodate your needs as often as you wish.

How to configure the Health-check feature

The feature called “health-check” helps you to check the status of your web servers with HTTP. You can use this feature to stop sending requests to servers that are down for maintenance or due to failures. Once fixed, requests are automatically dispatched to the server(s) again.

Here are the parameters necessary for configuring a health-check sensor:

  • Address of the sensor : this field is filled with one of the addresses declared on the web accelerator or on the web server. We recommend you use a simple script similar to the language used on your website.

In the event that you do not understand the significance of the values below, please leave the default values.

  • Check Intervals : waiting time between check-rounds for each server.
  • Timeout : max. response time for the web server before it is declared as unavailable.
  • Trigger window: this value corresponds to the number of checks required to determine that a server is or is not available. It is generally between 2 and 10.
  • Threshold value : this parameter specifies how many times the sensor has to run successfully to confirm a good server status. It is generally between 1 and 9 and must stay under the trigger window value.

If, for example, you set up a trigger window of 5 and a threshold value of 4, then the server will appear as available only if it responds positively to 4 requests out of 5.

Features

Cache

To learn more about how to setup and test caching for your website or application, please refer to the article dedicated to the Web Accelerator's Varnish cache system .

GeoIP

It is possible to use GeoIP on Gandi Simple Hosting instances, by recovering the value 'X-Country-Code' of the HTTP headers .

The value is returned in the form 'FR', 'EN', 'US', 'GB', etc. defined by the ISO norm 3166. You can find the complete list of country codes on the official website https://www.iso.org/obp/ui/

The country code is returned depending on the IP address of the visitor; both IPv4 and IPv6 addresses are supported.

This feature is useful for example in the event that you want to have a website in several languages, where the language is automatically displayed depending on the county of the visitor.

WebSocket

WebSocket support is now available in Alpha testing stage in the FR-SD2 (Paris, France) datacenter.

Learn more and follow a detailed example in the WebSocket on the Web Accelerator tutorial.

Troubleshooting

Requests don't make it to our web servers

If you have configured a firewall on your server, you must authorize the IP range 10.0.0.0/8 to be able to access your server. This is because the web accelerators send requests from IP addresses in this range, and so if your server does not accept them, then the web pages will not be able to be sent to the visitors via the accelerator.

Last modified: 07/11/2016 at 13:12 by Alexandre L. (Gandi)