Gandi Kitchen

Home > Hosting > SimpleHosting PaaS Platform

SimpleHosting PaaS Platform

More details

Our first abstracted system image is LAMP hosting: Linux, Apache, MySQL, and PHP. This is the most used combination of applications, but also among the most complicated to handle on a system and security level. Simple Hosting addresses these concerns with its robust architecture and scaling features. The architecture of SimpleHosting contains load-balancers in front of the caching server and in front of your personal instance. The instance is only available using HTTP through the clustered load-balancers, and uses SFTP to store your files. There is no plan to allow direct console access.

What you get is an instance of a Linux system with Apache2, PHP5 and MySQL installed. The files and application resources you place on it are up to you. Remember, this is not shared hosting across multiple customers. Another resource hungry web server will not cripple yours. At the load-balancer and caching server levels, all the virtual hosts are served by a group of machines, but all the data is partitioned.

Your instance has only one user, so:

  • you do not have to do any user rights management
  • you have a dedicated disk where all your data and application error logs are stored

You can use your instance to share privately accessible data using SFTP (through the /private directory).

Your instance has a dedicated apache2 daemon, so:

  • you can get all the data on application state, running queries, error logs, and more using the administration interface

Your instance has a dedicated PHP daemon, which means:

  • very few functional limitations as compared to shared hosting
  • you can change the PHP configuration using ini_set(). As the PHP5 interpreter runs as a fastCGI daemon, it performs better and allows greater resource control. Note: Configuring php_value in .htaccess file is disabled, due to fastCGI use
  • We use APC, a PHP opcode cache of 64 MB for size S instance, which is doubled at each larger size.
  • APC and PHP statistics are accessible using the administration interface.

Your instance has a dedicated MySQL daemon:

  • a full daemon to which you have root access
  • data is stored on your disk
  • configuration can be managed using PHPMyAdmin, available in your administration interface
  • there is no direct access to the MySQL port from outside your instance
  • memory use depends on the configuration of the various instance sizes, which have been set up to avoid swapping. There is no feature difference between PHP/MySQL on the different size packs

PHP and System Details

The instance is based on the Debian Linux distribution with standard upstream packages for the PHP5 interpreter and its modules. To get an exact listing of the version and included modules, see our wiki article or, for the result of a PHPinfo() command, look here. SimpleHosting is quite similar to servers that are available with our IAAS hosting, but configured to support a specific kind of web site.

The module list and configuration are set up by our technical team; you cannot install different PHP packages or Apache modules on your instance. However, if we see a significant quantity of requests for a specific module on our wishlist, we may decide to include the requested module or package in subsequent SimpleHosting images.

At the security level, our technical team will regularly update versions of libraries and interpreters on each SimpleHosting image. For example, the patch for the latest PHP5 security alert has already been applied to the LAMP instance. In the case of regular security alerts on PHP or PHP applications supplied by Gandi, our technical team will react quickly and apply fixes as quickly as possible following the announcement. We are monitoring security alerts on the PHP interpreter, on PHPMyAdmin (available in your administration interface), on apache2, MySQL, and on the base system (Linux kernel, libc6, ...). Be advised: Security alerts concerning the applications you install are of course your responsibility.

Performance

The platform architecture is designed to provide the shortest possible response time at each level:

  • dedicated memory space : your data stay cached in memory or in MySQL
  • PHP cache: APC, which is really efficient at the large memory sizes we configure
  • HTTP cache: Varnish provides efficient caching of static content to improve response time: pages and images that can be cached are served directly from the cache.

Scaling

This is the harder part to handle. If your site is successful, it may be rendered unavailable to your visitors by virtue of a lot of queries. You will have to take two parameters into account:

  • HTTP request flow : our Varnish farm is regulating this flow to avoid saturating your instance. If your pages can be cached, this process should be efficient. The quantity of data sent is capped with a quota, to avoid abusive behaviors.
  • Site complexity: Varnish cannot cache every byte of data. For example, if your site contains a lot of PHP pages using cookies, you will have to increase the size of your SimpleHosting instance to handle the query load.

Each size of SimpleHosting instance will start a specific number of PHP process (two for S size, for example). Each process can handle the generation of one dynamic page, and send the result to the visitors browser. For example, you can serve the contents of dynamic pages to two distinct visitors at the same exact time using a size S instance. Static pages are served directly by apache2 processes.

As generation of dynamic pages consumes CPU and RAM resources, we set up a maximum execution time (see the PHPinfo() output). Once the timeout value is reached, the PHP process will be stopped, and information about why it was stopped will be written to the error log. Your visitor will get an error message as a reply. If this is happening, you will need a larger instance size (for more processes) and/or a longer timeout. If your pages contains errors, you can easily find the information in the PHP error log available in your administration interface at http://"login".dc0.gpaas.net ("login" is your SimpleHosting login, a short numeric string).

Caching

Generated web pages served up by your SimpleHosting instance are added to a cache by a pool of Varnish servers, to handle heavy traffic by serving data already in the cache to new visitors. Obviously, you have the possibility to completely disable caching on your instance for all pages or one page, or to empty the cache at any time.

Directly in front of cache server, a couple of load-balancers help insure that visitors can reach the website on your instance. These appliances are reachable by a pool of IPV4 addresses associated to a set of names like "gpaasX.dc0.gandi.net", where X is an integer. IPV6 access is not yet available, due to a lack of hardware support: we are waiting for a new version of a firmware to correct it and allow ful IPv6 access.

Quick comments to finish off this article:

  • storage is provided on a compressed filesystem. The 10 GB feature in the SimpleHosting offer might actually contain much more data. Be careful not to fill it up, nonetheless!
  • the LAMP instance is designed to serve web pages and simple PHP apps like Drupal or Wordpress. It's not set up for streaming or large file downloads. Use it for what it is good for, and you will be successful.