<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet title="XSL formatting" type="text/xsl" href="http://gandikitchen.net/feed/rss2/xslt" ?><rss version="2.0"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:wfw="http://wellformedweb.org/CommentAPI/"
  xmlns:content="http://purl.org/rss/1.0/modules/content/"
  xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
  <title>Gandi Kitchen</title>
  <link>http://gandikitchen.net/</link>
  <atom:link href="http://gandikitchen.net/feed/rss2" rel="self" type="application/rss+xml"/>
  <description></description>
  <language>en</language>
  <pubDate>Sat, 31 Jul 2010 07:57:29 +0200</pubDate>
  <copyright></copyright>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Dotclear</generator>
  
    
  <item>
    <title>Kernel and cmdline</title>
    <link>http://gandikitchen.net/post/2010/06/03/Kernel-and-cmdline</link>
    <guid isPermaLink="false">urn:md5:a3c801954150fd2ff74e3a83587a28e4</guid>
    <pubDate>Thu, 03 Jun 2010 11:00:00 +0200</pubDate>
    <dc:creator>Ryan</dc:creator>
        <category>Hosting</category>
            
    <description>    We are pleased to announce that you can (finally!) choose the version of your kernel that you want (from a list which will be continually expanded), and associated boot options (cmdline). 2.6.18 and 2.6.27 are &amp;quot;base&amp;quot; versions supplied by Xen (backport of Xen patches for 2.6.27). Version 2.6.32, which is is currently available, uses paravirt_ops and the &amp;quot;Linux&amp;quot; implementation of Xen patches.
&lt;br /&gt;
&lt;br /&gt;

We will show you the new kernels here. They can be found in the &amp;quot;advanced mode&amp;quot; within the server's management page:
&lt;br /&gt; &lt;br /&gt;
&lt;img src=&quot;http://gandikitchen.net/public/kitchen-en/server-info-en.jpeg&quot; alt=&quot;server-info-en.jpeg&quot; style=&quot;margin: 0 auto; display: block;&quot; title=&quot;server-info-en.jpeg, Jun 2010&quot; /&gt;
 &lt;br /&gt;
&lt;br /&gt;
And you will then be able to access:
 &lt;br /&gt;
&lt;br /&gt;
&lt;img src=&quot;http://gandikitchen.net/public/kitchen-en/.advanced-mode-en_m.jpg&quot; alt=&quot;advanced-mode-en.jpeg&quot; style=&quot;margin: 0 auto; display: block;&quot; title=&quot;advanced-mode-en.jpeg, Jun 2010&quot; /&gt;
&lt;br /&gt;
&lt;br /&gt;

Concerning cmdline, you may now deactivate selinux at boot, boot as a single user, change the disk and the boot partition (which is practical for working with &amp;quot;images&amp;quot;), or choose the most appropriate console for your needs. In short, everything that you need to manage your updates in a more friendly environment, or to repair your server in the most autonomous manner.
 &lt;br /&gt;
&lt;br /&gt;

If you feel that an option is missing, please let us know.</description>
    
    
    
          <comments>http://gandikitchen.net/post/2010/06/03/Kernel-and-cmdline#comment-form</comments>
      <wfw:comment>http://gandikitchen.net/post/2010/06/03/Kernel-and-cmdline#comment-form</wfw:comment>
      <wfw:commentRss>http://gandikitchen.net/feed/rss2/comments/1579</wfw:commentRss>
      </item>
    
  <item>
    <title>Mandriva 2010 image in alpha</title>
    <link>http://gandikitchen.net/post/2010/05/21/Mandriva-2010-image-in-alpha</link>
    <guid isPermaLink="false">urn:md5:47d5903efdbf3db15eb2c8434d692337</guid>
    <pubDate>Fri, 21 May 2010 17:35:00 +0200</pubDate>
    <dc:creator>aegiap</dc:creator>
        <category>Hosting</category>
        <category>alpha</category><category>hosting</category><category>mandriva</category>    
    <description>    &lt;p&gt;Server hosting by Gandi allow customers to choose from a selection of OS images
available during the creation process of the virtual server. After the creation
of the image by Gandi and internal testing, a new distribution is released to
a specific group of hosting  customers called 'alpha'. These clients can create
server using these release candidate images. This allows Gandi to increase the
types of testing and usage, and to find more bugs and problems by working with a small group
of its customers.&lt;/p&gt;


&lt;p&gt;Today - May the 21th - the Mandriva 2010.0 image has been released . This new version
of the Mandriva distribution boots with a 2.6.27 kernel by default. It is currently only
available for the 'alpha' customer group but will shortly be available for all customers.
Please contact us if you wish to participate in our alpha testing phase.&lt;/p&gt;</description>
    
    
    
          <comments>http://gandikitchen.net/post/2010/05/21/Mandriva-2010-image-in-alpha#comment-form</comments>
      <wfw:comment>http://gandikitchen.net/post/2010/05/21/Mandriva-2010-image-in-alpha#comment-form</wfw:comment>
      <wfw:commentRss>http://gandikitchen.net/feed/rss2/comments/1575</wfw:commentRss>
      </item>
    
  <item>
    <title>Cherokee Arrives at Gandi</title>
    <link>http://gandikitchen.net/post/2010/04/29/Cherokee-Arrives-at-Gandi</link>
    <guid isPermaLink="false">urn:md5:78dbdb8d5ebcfbf2d9a05a86edbf4fb5</guid>
    <pubDate>Thu, 29 Apr 2010 13:48:00 +0200</pubDate>
    <dc:creator>Leland Vandervort</dc:creator>
        <category>Hosting</category>
            
    <description>    &lt;p&gt;(Translator's note: Taskigi Sequoyah would be proud! ;) )&lt;/p&gt;
&lt;p&gt;A friend had explained to me that he had just finished installing a web server.  Having decided on a change and not to use the mammoth &lt;strong&gt;Apache&lt;/strong&gt; that everyone knows and loves, my friend seemed to have found a decent alternative.  Bearing the name Cherokee, it appeared much leaner and with greater performance than Apache.  See the benchmarks from the &lt;a href=&quot;http://www.cherokee-project.com/benchmarks.html&quot;&gt;project website&lt;/a&gt; at the end of this article. &lt;/p&gt;
&lt;p&gt;Personally, I had no knowledge of Cherokee, though I had certainly heard the name pandered around once or twice, but I never really paid it any attention at the time.  So to give it a whirl, I decided to install it locally, which to my surprise exceeded my expectations.  On a debian (or derived) distribution, installation is achieved by a simple &lt;q&gt;&lt;code&gt;apt-get install cherokee&lt;/code&gt;&lt;/q&gt; (or 'aptitude'...)&lt;/p&gt;
&lt;p&gt;The web management interface provided is clean and intuitive.  The basic idea is quite interesting;  It is possible to activate the PHP interpreter with a simple mouse click; same for activating different virtual hosts as well as other options.  There are also wizards to assist with the installation of such applications and frameworks as Django, Rails or Wordpress, etc.&lt;/p&gt;
&lt;p&gt;I thought that it would be interesting to present this project during a developers meeting at Gandi, especially for those who use GandiAI.  The presentation was well received.  After a few pow-wow, and a glance through the source code, there was nothing really unusual or risky.  This doesn't mean, of course, that there aren't any bugs in it, but at any rate clean code is a good sign!  The core is written in C with the administrator interface written in Python.&lt;/p&gt;
&lt;p&gt;Thus is the way in which Cherokee made its appearance at Gandi, and a server image was produced.  In this way you can rapidly test a server with Cherokee pre-installed.&lt;/p&gt;
&lt;p&gt;We have also added an &amp;quot;expert&amp;quot; mode distribution with Cherokee pre-installed... You need only to select this distribution during the steps to create your server.  And, just as a reminder, in case you haven't yet tried our service, you can always request a free trial using &lt;a href=&quot;http://en.gandi.net/hosting/trial/&quot;&gt;our online form&lt;/a&gt;!&lt;/p&gt;
&lt;p&gt;For further information about Cherokee, you can visit the &lt;a href=&quot;http://www.cherokee-project.com/&quot;&gt;project website&lt;/a&gt;.  Additionally, you can find a comprehensive article about Cherokee in the Gnu/Linux magazine France, written [in French] by Carl Chenet in &lt;a href=&quot;http://ed-diamond.com/produit.php?ref=lmag125&amp;amp;id_rubrique=1&amp;amp;caracteristique=1-2-&amp;amp;caracdisp=2-3-&quot;&gt;issue number 125&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;&lt;img title=&quot;nb of clients / queries per seconds, avr 2010&quot; style=&quot;margin: 0 auto; display: block;&quot; alt=&quot;&quot; src=&quot;http://gandikitchen.net/public/./.benchmark_m.jpg&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img title=&quot;benchmark-0.8, avr 2010&quot; style=&quot;margin: 0 auto; display: block;&quot; alt=&quot;&quot; src=&quot;http://gandikitchen.net/public/web-servers-benchmark-20080819.jpg&quot; /&gt;&lt;/p&gt;</description>
    
    
    
          <comments>http://gandikitchen.net/post/2010/04/29/Cherokee-Arrives-at-Gandi#comment-form</comments>
      <wfw:comment>http://gandikitchen.net/post/2010/04/29/Cherokee-Arrives-at-Gandi#comment-form</wfw:comment>
      <wfw:commentRss>http://gandikitchen.net/feed/rss2/comments/1565</wfw:commentRss>
      </item>
    
  <item>
    <title>E-Mail 'Goes Postal' - Gandi Mail Version 2</title>
    <link>http://gandikitchen.net/post/2010/03/26/E-Mail-Goes-Postal-Gandi-Mail-Version-2</link>
    <guid isPermaLink="false">urn:md5:9967f53e7f57fb310547cf4ce7693070</guid>
    <pubDate>Fri, 26 Mar 2010 14:54:00 +0100</pubDate>
    <dc:creator>Leland Vandervort</dc:creator>
        <category>Mail</category>
        <category>Mail</category>    
    <description>&lt;p&gt;Okay, excuse the corny punch line, but for those who haven't heard the expression, to &amp;quot;go postal&amp;quot; simply means to go crazy.  Without delving into the origins of the phrase, suffice it to say that the term these days can also mean to go crazy or emphatic in a positive sense as well.. (or so some would like to believe ;-) )&lt;/p&gt;
&lt;p&gt;As many may know by now, the Gandi Mail platform in the past couple of years has seen a few recurring instances of performance degradation every couple of months.  As mentioned on the Gandi Bar, our teams have been working to bring you a new and more robust mail platform.  This new platform is the culmination of a considerable amount of resource investment over many months.&lt;/p&gt;
&lt;p&gt;I am pleased to say that the new platform is fully operational and all Gandi Mail customers are fully migrated to the new system, with the migration itself taking about six weeks or so.  We decided to stage the migration gradually over a number of weeks to minimise any impact to our customers, and for the most part (with a very small handful of exceptions), the bulk of the migration was completed without anyone even noticing ;)&lt;/p&gt;
&lt;p&gt;Anyway, without further ado, let's take a brief tour of the new mail platform and what has changed in Gandi Mail version 2.  Oh.. and before we go on, this article will be at times a little bit technical with the use of some acronyms and other geek-speak.  Don't worry, you'll soon get the gist of what we bearded technophiles blabber on about on a daily basis!  ;)&lt;/p&gt;    &lt;h2&gt;In the Beginning, There Was the Word...&lt;/h2&gt;
&lt;p&gt;... and the word was written.. and ever since the dawn of the internet, the written word has become a critical part of our lives... yes.. that's right... e-mail.  So, as a domain registrar, Gandi provides email services for use with the domains registered with us.  So far so good... &lt;/p&gt;
&lt;p&gt;The original platform was designed to be horizontally scalable to support several tens or even hundreds of thousands of mailboxes.  One of the challenges faced was an architecture that had scalable storage capability whilst at the same time allowing the user to access his or her mailbox irrespective of which storage system or access server he or she connected to.  Sounds like a job for the good old Network File System (NFS).  As a result, the original platform was based on an NFS storage infrastructure for the mailboxes.  &lt;/p&gt;
&lt;p&gt;Incoming mail was received on any one of a number of inbound spool servers running Postfix.  Once the mail was received and passed through a number of anti-spam and other filters, the spool would then identify which storage filer contained the mailbox in question, and forward the mail using SMTP to the back-end storage server (itself also running Postfix) for local delivery.&lt;/p&gt;
&lt;p&gt;When the user wanted to access his or her mailbox, he would access a front-end server running Dovecot.  The access servers would have &amp;quot;local&amp;quot; access to all of the mailboxes through the use of NFS mounts.  The user would simply use a POP or IMAP client to connect to the server, to access his or her mailbox.&lt;/p&gt;
&lt;p&gt;Outgoing mail is quite simple; basically an SMTP relay using SASL authentication.&lt;/p&gt;
&lt;p&gt;The following diagram shows a very high level overview of the original version of the mail platform.&lt;/p&gt;
&lt;p&gt;&lt;img title=&quot;Gandi Mail Version 1, mar 2010&quot; style=&quot;margin: 0 auto; display: block;&quot; alt=&quot;&quot; src=&quot;http://gandikitchen.net/public/GandiMailV2/.gm-v1_m.jpg&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;So What Has Changed?&lt;/h2&gt;
&lt;p&gt;Okay - before we get to the &amp;quot;what&amp;quot; has changed - let's first look at &amp;quot;why&amp;quot; we had to change it.  &lt;/p&gt;
&lt;p&gt;The original platform was great and the architecture works very well for moderate traffic levels, irrespective of the number of mailboxes.  The risk with scaling a platform based on the number of mailboxes is that it is easy to overlook, or in some cases, misinterpret the knock-on effects of that increased scale.  As the amount of traffic began to increase over the years, from time to time the front-end access servers would start having to contend for access to the NFS filesystems, which uses a system of locks to avoid corruption that may occur when there are multiple read/write operations on the same file or block.  &lt;/p&gt;
&lt;p&gt;This diagram outlines the average volumes for the past year.  (note that the graph is not &amp;quot;stacked&amp;quot;, so the elements are cumulative.)  The vertical axis is &amp;quot;messages per minute&amp;quot;, while the horizontal axis is by month.&lt;/p&gt;
&lt;p&gt;&lt;img title=&quot;Avg Msgs per Minute - year, mar 2010&quot; style=&quot;margin: 0 auto; display: block;&quot; alt=&quot;&quot; src=&quot;http://gandikitchen.net/public/GandiMailV2/.volume-msg-per-min-year_m.jpg&quot; /&gt;&lt;/p&gt;
&lt;p&gt;As these locks increased over time (and remember that all of the servers had access across all of the filesystems), the result was a snowball effect that caused severe performance degradation of the whole platform -- and not only for the mailboxes on the storage server with the lock in place.  During this time, users would attempt to connect to their mailboxes at which time the server would accept the connection and simply wait for the lock to free in order to access the mailbox.&lt;/p&gt;
&lt;p&gt;So the challenges were simple:  &lt;/p&gt;
&lt;ul&gt;&lt;li&gt;How to eliminate the need for NFS and still allow horizontal scalability.&lt;/li&gt;
&lt;li&gt;How to avoid impacting the entire mail platform in case of a difficulty on just one storage server, and how to minimise the impact to customers in this case.&lt;/li&gt;
&lt;li&gt;How to maximise the performance of the platform to allow vertical scalability as well as horizontal.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Since there is very little change on the incoming SMTP spool elements, and the majority of the load was associated with NFS, let's look straight as the access elements.&lt;/p&gt;
&lt;h2&gt;Where Is My Mailbox?&lt;/h2&gt;
&lt;p&gt;Okay, so the user connects to his mailbox with his mail client (Thunderbird, Outlook Express, Mail.App, Evolution, or anything else for that matter...).  The client connection arrives on one of a number of front-end mail access servers running Dovecot.  How then, does the server know where to look to find the mailbox?  Originally, the mailbox was &amp;quot;local&amp;quot; because it was mounted via NFS.  Dovecot made a simple database lookup to determine the filesystem path that the mailbox was mounted under.  With the new system, there is no NFS, so there is no &amp;quot;local&amp;quot; filesystem for Dovecot to look under.&lt;/p&gt;
&lt;p&gt;This is where a very useful feature of Dovecot come into play -- the proxy function.  Using this, the front end server performs the authentication of the user, checks which storage server the mailbox is located on, and then initiates a proxy &amp;quot;client&amp;quot; connection directly to the storage server which itself is running Dovecot.  If the client connects using IMAP, then the proxy connection is also IMAP.  Similarly if the client is using POP3, then the proxy is also POP3.  The storage server does not need to re-authenticate the connection.&lt;/p&gt;
&lt;p&gt;&lt;img title=&quot;Gandi Mail Version 2 - Access, mar 2010&quot; style=&quot;margin: 0 auto; display: block;&quot; alt=&quot;&quot; src=&quot;http://gandikitchen.net/public/GandiMailV2/.gm-v2-access_m.jpg&quot; /&gt;&lt;/p&gt;
&lt;p&gt;There are a few benefits of this architecture:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Elimination of NFS also eliminates the side-effect of NFS locks.&lt;/li&gt;
&lt;li&gt;Since the back-end storage server actually has the mailbox physically locally attached, there is no contention on the filesystem, and no need for locks.  Plus, since the storage arrays are high performance anyway, access to the mailbox is much faster.&lt;/li&gt;
&lt;li&gt;The front-end servers no longer have to perform local disk I/O operations, and thus consume considerably less CPU.  (In fact, technically, there is no real reason for the front-end servers to even have disks of their own -- this could enable lower cost horizontal access scaling by being able to use diskless servers...)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;What Happens if a Filer Breaks?&lt;/h2&gt;
&lt;br /&gt;To respond to the other part of the challenge, and to limit the impact in case of component failure to as few customers as possible, the original concept of scaling storage to hold as many mailboxes as possible had to be discarded.  After all, if a filer happened to fall over, all the mailboxes on that filer would also be offline.  &lt;br /&gt;&lt;br /&gt;So the idea here is to increase the number of storage servers, and spread the mailboxes more thinly across them.  In this way, in case of a failure of the storage server, fewer mailboxes are affected.&lt;br /&gt;&lt;br /&gt;The second aspect to minimising the impact of a component failure is fairly simple as well.  With the previous version of the platform (yes, remember the NFS locks?), a client connection to a mailbox would be answered by the access server and simply wait for the filesystem access.  The effect for the user is that his client would just &amp;quot;sit there&amp;quot; and eventually time out.&lt;br /&gt;&lt;br /&gt;Using the IMAP/POP3 proxy arrangement, if the actual storage server is down, the front-end server will reply immediately to the mail client with a &amp;quot;Temporarily Unavailable&amp;quot; message, and the TCP connection is closed.&lt;br /&gt;&lt;br /&gt;The disks arrays themselves are, of course, redundant.  The only real potential single point of failure is the server that controls the disk arrays since due to technical limitations of the disk arrays, it is not possible to have dual controllers if using split and mirrored RAID volumes across two disk arrays.  It would have been possible if the volumes weren't mirrored across arrays, but this would have been more risky as there would be no &amp;quot;backup&amp;quot; copy of the data volume in case of an array failure... we thus considered that the single controller server is an acceptable risk provided a spare is available and can be easily swapped in.  The following image depicts the mail storage solution.&lt;br /&gt;&lt;br /&gt;&lt;img title=&quot;Mail Filer, mar 2010&quot; style=&quot;margin: 0 auto; display: block;&quot; alt=&quot;&quot; src=&quot;http://gandikitchen.net/public/GandiMailV2/.filer_m.jpg&quot; /&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;But.. I Didn't Notice the Migration&lt;/h2&gt;
If you are in this category, then all I can say is &amp;quot;super!&amp;quot; -- that's what we intended.  Though, we did have one or two hiccups along the way, and a very small minority of customers noticed, at no point was data lost, jeopardised, or otherwise endangered :)&lt;br /&gt;&lt;br /&gt;So, how did we do the migration?  Well, over a course of a number of weeks, and mostly during off-peak times, our admins worked on one filer at a time, migrating all customer mailboxes to the new filer structure using rsync... several iterations of it, in fact.  At the last iteration to fully synchronise, the database was immediately updated to reflect the new filer as the storage location of the mailbox.  All new deliveries, access requests, etc., were then made to the new filer.&lt;br /&gt;&lt;br /&gt;This process went on filer by filer over the course of a number of weeks.  An interesting side-effect of this migration and the gradual removal of NFS from the architecture is the gradual reduction of average CPU load of the access servers over the migration period, as can be seen in the graphs below.  Of course now the CPU load is pretty much negligible since NFS has been eliminated.  The two graphs are relative scale based on the average of the time period.  The first graph is the past six months, while the second graph is the average over the past five weeks.&lt;br /&gt;&lt;br /&gt;&lt;img title=&quot;Access Server CPU Load - six months, mar 2010&quot; style=&quot;margin: 0 auto; display: block;&quot; alt=&quot;&quot; src=&quot;http://gandikitchen.net/public/GandiMailV2/server-cpu-6month.png&quot; /&gt;&lt;br /&gt;&lt;img title=&quot;Access Server CPU Load - One Month, mar 2010&quot; style=&quot;margin: 0 auto; display: block;&quot; alt=&quot;&quot; src=&quot;http://gandikitchen.net/public/GandiMailV2/.server-cpu-month_m.jpg&quot; /&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Some Interesting Figures&lt;/h2&gt;
Here are just a few interesting facts about the Gandi Mail platform.&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Average &lt;strong&gt;60 million emails per day&lt;/strong&gt; via the SMTP incoming spools and outgoing relays.&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;&lt;li&gt;8 outgoing SMTP relays&lt;/li&gt;
&lt;li&gt;8 incoming SMTP spools&lt;/li&gt;
&lt;li&gt;10 mail filters (anti-spam, etc.)&lt;/li&gt;
&lt;li&gt;7 front-end access servers (POP3 / IMAP)&lt;/li&gt;
&lt;li&gt;16 mailbox storage filers&lt;/li&gt;
&lt;li&gt;4 database servers (2 read plus 2 master with replication)&lt;/li&gt;
&lt;li&gt;Hardware distributed among multiple datacentres&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
Just a Quick Stats Update Three Days Later&lt;/h2&gt;
&lt;br /&gt;Just wanted to add a quick update to the IO-Wait CPU load for the front-end servers now three days on.  In the following graph showing the CPU load on the front-end access servers for the past seven days, you can see the significant difference before and after the final migration ;)&lt;br /&gt;&lt;br /&gt;&lt;img title=&quot;IO-wait CPU 7 days, mar 2010&quot; style=&quot;margin: 0 auto; display: block;&quot; alt=&quot;&quot; src=&quot;http://gandikitchen.net/public/GandiMailV2/.io-wait-7day_m.jpg&quot; /&gt;&lt;br /&gt;&lt;br /&gt;I hope that this article has given a useful insight into the new Gandi Mail platform.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;</description>
    
    
    
          <comments>http://gandikitchen.net/post/2010/03/26/E-Mail-Goes-Postal-Gandi-Mail-Version-2#comment-form</comments>
      <wfw:comment>http://gandikitchen.net/post/2010/03/26/E-Mail-Goes-Postal-Gandi-Mail-Version-2#comment-form</wfw:comment>
      <wfw:commentRss>http://gandikitchen.net/feed/rss2/comments/1555</wfw:commentRss>
      </item>
    
  <item>
    <title>Gandi 10th Anniversary - The Experience</title>
    <link>http://gandikitchen.net/post/2010/03/17/Gandi-10th-Anniversary-The-Experience</link>
    <guid isPermaLink="false">urn:md5:0725b243853c7b857f2f4da85266e035</guid>
    <pubDate>Wed, 17 Mar 2010 19:33:00 +0100</pubDate>
    <dc:creator>Leland Vandervort</dc:creator>
        <category>Hosting</category>
        <category>Hosting</category>    
    <description>&lt;p&gt;To celebrate Gandi's 10th anniversary, this hair-brained idea to give away, in ten days, 55000 domains, raise a very practical question.  How, once we open the floodgates on such an operation, to maintain the highest quality of service on the site?  The festive spirit could well have transformed into a nightmare for our customers if they were suddenly unable to access their management interface.&lt;/p&gt;
&lt;p&gt;So we took the decision to host the event on a dedicated site.  This was a hitherto dreamed of occasion to put ourselves into our customers' shoes, and use our hosting infrastructure for this event.  We defined the rules of play:  Using only the tools provided to our customers, build an architecture which was easily scalable and didn't break the bank, and to demonstrate our renowned flexibility.&lt;/p&gt;    &lt;br /&gt;
&lt;h3&gt;Keep it Simple, Stupid.&lt;/h3&gt;
&lt;p&gt;We had the &amp;quot;luxury&amp;quot; of one week from design to implementation. As a result, the charming idea to demonstrate our &amp;quot;cloudlike&amp;quot; site based on modern technology was summarily put out of our minds. To be perfectly honest, given the time scale, the lucky chosen developer had a nifty precept to select the technology: &amp;quot;You have full choice of the technology, but you have one week.&amp;quot; It would be PHP/MySQL, which isn't exactly everybody's favourite! It would, nevertheless, allow us to release a tested site within the tight time frame.&lt;/p&gt;
&lt;p&gt;To adequately sustain the load generated by such an event, several servers would be needed. We then hit our first stumbling block: Gandi does not [yet] have a load balancing solution for the hosting solution! Nevermind, we'll use the old yet faithful round-robin DNS method, with a low TTL to be able to quickly remove a front-end server from production in case of an incident.&lt;/p&gt;
&lt;p&gt;Our Linux distribution for this occasion would be Ubuntu 9.10 - because it is reasonably up-to-date, with the 2.6.27 kernel.&lt;/p&gt;
&lt;br /&gt;
&lt;h3&gt;Small Servers - Go Forth and Multiply!&lt;/h3&gt;
&lt;p&gt;The best way to sustain the high loads for our solution is to split the functionality among several small servers. This way we would maintain a minimum level of &amp;quot;vertical&amp;quot; scalability (you can dynamically increase the memory and CPU allocated to a server), and the architecture provides &amp;quot;horizontal&amp;quot; scalability.&lt;/p&gt;
&lt;p&gt;In this way we could easily add resources if we started to feel the pinch, and add or migrate shares from one server to another as load requirements necessitate. There are numerous advantages of using multiple small servers:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;each server gets a minimum of one core, burstable, of the CPU (yes, one whole core, even with one share -- that's new, by the way!)&lt;/li&gt;
&lt;li&gt;assured resilience, with shares spread somewhat randomly across a few hundred different physical servers.&lt;/li&gt;
&lt;li&gt;specifically in a virtualised environment, the memory performance is best with less than 1GB of memory.&lt;/li&gt;
&lt;li&gt;if you have 4 servers of one share each, rather than one big server of 4 shares, they can dynamically increase to 8x4 shares, or 24x4 shares with a reboot, and all of this without modification to the architecture. A big server, however, would only scale to 8 shares without a reboot, or 24 after reboot.&lt;/li&gt;
&lt;li&gt;resources may be easily moved towards servers that need it most&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We commence with a simple architecture:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;24 (!) servers of one share each, to manage the PHP website: 10 for the English site, 10 for the French site, and an additional 2 of each for IPv6.&lt;/li&gt;
&lt;li&gt;2 servers of 4 shares each for replicated memcached to reduce database load and manage sessions.&lt;/li&gt;
&lt;li&gt;1 MySQL server of 4 shares, which contains the pre-generated promotion codes (they actually all fit within memory, so the database itself should really be pretty bored doing nothing...)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;After a couple of lovely overloads and a bit of code review, the database would finally be greatly spared by memcached (see the section &amp;quot;&lt;a href=&quot;http://gandikitchen.net/post/2010/03/17/#code&quot;&gt;lightweight coding...&lt;/a&gt;&amp;quot;).&lt;/p&gt;
&lt;p&gt;One of our administrators would put his fingers to work on the site to create and configure 24 servers -- at the same time! Obviously the release of the hosting API or an admin interface function would have been welcome. (Thanks to &lt;ins&gt;cssh&lt;/ins&gt; in this case!)&lt;/p&gt;
&lt;br /&gt;
&lt;h3&gt;Lock Down (somewhat) the Machines&lt;/h3&gt;
&lt;p&gt;A default installation always needs a few finishing touches. The very fact of opening a MySQL database on the &amp;quot;public&amp;quot; network made us a little edgy. So, swooping 'netstat' and shutting down non-critical services listening on public ports. With the help of tcp wrappers (hosts.allow, hosts.deny), all of the &amp;quot;private&amp;quot; interfaces are also locked down (sshd, mysql accessibly only from the web farm).&lt;/p&gt;
&lt;p&gt;Finally it behooved us to pay close attention to the PHP code and MySQL queries; The safest way to avoid php code injections is to bind all the parameters after a prepare(). This also helps reduce load on the database when several execute() are called.&lt;/p&gt;
&lt;p&gt;One important detail: since the site should allow a user to send an email to any &amp;quot;arbitrary&amp;quot; address, it was absolutely critical to limit its potential for abuse by some clever black-hat as much as possible. At the very minimum, the number of sent emails per promotion code was limited, in addition to very close monitoring.&lt;/p&gt;
&lt;br /&gt;&lt;h3&gt;Setup the Development and Deployment Environment&lt;/h3&gt;
&lt;p&gt;The sharing of data between the sites in effect adds a single point of failure, as well as a potential architectural bottleneck. As such, we decided to deploy the content of the site locally on each of the servers. We would use one server for developing and staging, and ultimately for the development and testing of updates. A quick script and some 'rsync' would allow rapid deployment across the entire front-end architecture. Simple! (some would say ;) )&lt;/p&gt;
&lt;br /&gt;
&lt;h3&gt;Resource Monitoring&lt;/h3&gt;
&lt;p&gt;A few moments before the operation, more as a precaution rather than a cure, all of the virtual machines from one to two shares. Using the statistics interface, from day one, one can see that the the virtual machines were essentially sitting &amp;quot;twiddling their thumbs&amp;quot; from boredom ;) :&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;CPU on a Front-end Webserver&quot; title=&quot;CPU on a Front-end Webserver, mar 2010&quot; src=&quot;http://www.lacuisinedegandi.net/public/./.console.gandi.net.cpu_m.jpg&quot; /&gt;
&lt;img alt=&quot;Network interface on a front-end Websever&quot; title=&quot;Network interface on a front-end Webserver, mar 2010&quot; src=&quot;http://www.lebardegandi.net/public/./.console.gandi.net.vif_m.jpg&quot; /&gt;
&lt;/p&gt;
&lt;p&gt;It would have been cool, at this very moment, to reduce back to a single share per server, or make use of Gandi &amp;quot;Autoflex&amp;quot;, or even given the actual load observed, set up scheduled flex for each hour to hand out the promotion codes! Unfortunately, with all hands on deck, we missed this opportunity to demonstrate this [econono-techno-ecological ;)] feature.&lt;/p&gt;
&lt;br /&gt;
&lt;h3 id=&quot;code&quot;&gt;Lightweight Code is Worth More than a Thousand Beefy CPUs&lt;/h3&gt;
&lt;p&gt;Even though we physically had several thousand CPUs and a few Terabytes of RAM at our fingertips, Tuesday turned out to be somewhat chaotic and worthy of note here. After Monday, which managed the load very well, the &amp;quot;smooth&amp;quot; execution of our one and only SELECT COUNT brutally altered and became excruciatingly slow (300ms). We had naively thought that this &amp;quot;only&amp;quot; query, on a table held exclusively in memory, wouldn't be an issue. As such, it was executed on every page of the site. The multiple simultaneous accesses to the database, coupled with the UPDATE operations for the promotion codes, resulted in the database, despite the near-idle system performance, started causing database lock contention.&lt;/p&gt;
&lt;p&gt;The usual knee-jerk reaction to such a situation is to increase the number of shares to support the load. It's great for a quick-fix temporary solution, but it's not enough!&lt;/p&gt;
&lt;p&gt;A new analysis of the system, questions about the code, and the use (or salvation) of memcached resulted in recovering the optimal performance. Equally, a modification of the database queries used probably would have been prudent.&lt;/p&gt;
&lt;p&gt;The moral of the story: the code, indexes, architecture (etc.) are the cornerstones of your ability to support usage load, and if they are &amp;quot;CPU friendly&amp;quot;, they will save the day. Otherwise a catastrophe could be lurking, or at the very least, the unnecessary purchase of additional shares.&lt;/p&gt;
&lt;p&gt;Also, as we said earlier somewhat tongue-in-cheek -- it's eco-friendly!&lt;/p&gt;
&lt;br /&gt;
&lt;h3&gt;Some Numbers&lt;/h3&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;36 shares total, but we could have done it with less (*sniff*)&lt;/li&gt;
&lt;li&gt;5% CPU usage at peak&lt;/li&gt;
&lt;li&gt;4000 requests per front-end web server in the first minute of each hour (roughly 1400 requests/second total)&lt;/li&gt;
&lt;li&gt;a minimum of 11 seconds to hand out 1000 promotion codes.&lt;/li&gt;
&lt;li&gt;a maximum of 40 minutes to hand out the same number of promotion codes, during the Tuesday incident described above.&lt;/li&gt;
&lt;/ul&gt;</description>
    
    
    
          <comments>http://gandikitchen.net/post/2010/03/17/Gandi-10th-Anniversary-The-Experience#comment-form</comments>
      <wfw:comment>http://gandikitchen.net/post/2010/03/17/Gandi-10th-Anniversary-The-Experience#comment-form</wfw:comment>
      <wfw:commentRss>http://gandikitchen.net/feed/rss2/comments/1550</wfw:commentRss>
      </item>
    
  <item>
    <title>What to do if your server stops responding?</title>
    <link>http://gandikitchen.net/post/2010/01/13/What-to-do-if-your-server-stops-responding</link>
    <guid isPermaLink="false">urn:md5:5b20bdf2051d86a8ff1da3f97a90b4b5</guid>
    <pubDate>Wed, 13 Jan 2010 13:26:00 +0100</pubDate>
    <dc:creator>Ryan</dc:creator>
        <category>Hosting</category>
            
    <description>As you probably already know, our platform protects you from hardware failures that might occur on your server.
&lt;br /&gt;
&lt;br /&gt;
In the event of a problem on the machine, or if we suspect that a problem might occur (abnormal temperature, corrupted memory, etc.), your “server” will automatically be migrated to another machine.
However, if you have an internal problem on your &amp;quot;server&amp;quot; that is not to due to the physical machine, and if it no longer responds, then you will need to take action.    &lt;br /&gt;
 The first action to take is to be sure that your server’s status is shown as “Running” on your Gandi interface. This is because the status may also be “Stopped” or “Paused” if, for example, it has not been renewed. So given that it is &amp;quot;Running&amp;quot; and non-responding, here's what to do.
&lt;br /&gt;
&lt;br /&gt;
&lt;ins&gt;&lt;strong&gt;There are three different cases:&lt;/strong&gt;&lt;/ins&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;1. You can still connect to your server via SSH.&lt;/strong&gt; In this case, the following commands will help you analyze the situation:
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&amp;quot;&lt;strong&gt;uptime&lt;/strong&gt;&amp;quot;  will give you the current load of the machine,&lt;/li&gt;
&lt;li&gt;&amp;quot;&lt;strong&gt;free&lt;/strong&gt;&amp;quot;, will show you the amount of memory used by your applications in the “used” column,&lt;/li&gt;
&lt;li&gt;&amp;quot;&lt;strong&gt;top&lt;/strong&gt;&amp;quot; (we recommend that you install “htop&amp;quot;) will show you the ranking of applications in realtime ordered by their use of resources (memory, CPU),&lt;/li&gt;
&lt;li&gt; &amp;quot;&lt;strong&gt;dmesg&lt;/strong&gt;&amp;quot; shows you messages from your linux server’s kernel,&lt;/li&gt;
&lt;li&gt;Consulting logs such as /var/log/messages or /var/log/daemons with the command, “tail”, for example (tail /var/log/daemons) will also provide you with precious information. &lt;/li&gt;
&lt;li&gt;&amp;quot;&lt;strong&gt;df –h&lt;/strong&gt;&amp;quot; shows you the amount of disk space available on your disks.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;strong&gt;The most frequent causes of error are:&lt;/strong&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;No space left on your system disk: this situation is often caused by a lack of appropriate log management on the server, or by a database which fills up too quickly. The solution is to clean up wasted space, or enlarge the disk (see the &lt;a href=&quot;http://wiki.gandi.net/en/hosting/manage-disk/resize-disk&quot;&gt;guide&lt;/a&gt; on this).&lt;/li&gt;
&lt;li&gt;Not enough RAM on the server, or too much memory used: the simple solution is to add more RAM by adding additional shares. If you have an expert server, you can also try to modify the behavior of the Linux’s available memory by using the command 'sysctl -w vm.overcommit_memory = 2'. &lt;strong&gt;Warning:&lt;/strong&gt; so that the modification can be maintained following a reboot, you must also add &amp;quot;vm.overcommit_memory = 2&amp;quot; to the &amp;quot;/etc/sysctl.conf&amp;quot; and &amp;quot;/etc/gandi/sysctl.conf&amp;quot; files.&lt;/li&gt;
&lt;li&gt; Too may processes are running simultaneously on your machine: you will need to lower the values in the configuration files of your applications (the number of simultaneous connections on Apache, for example) or increasing the power of your server by adding shares.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;strong&gt;2. You can no longer connect to your server under SSH, and it does not respond to ping or it has a slow response time.&lt;/strong&gt;
&lt;br /&gt;
&lt;br /&gt;
The &lt;strong&gt;virtual console&lt;/strong&gt; which you may activate from your account (&lt;a href=&quot;http://wiki.gandi.net/en/hosting/using-linux/how_to_use_console&quot;&gt;guide available&lt;/a&gt;), gives you direct access to your machine as if a monitor and a keyboard (still virtual) were directly attached to the server.
&lt;br /&gt;
&lt;br /&gt;
In this case, you can stop all the applications that are causing problems, and once again get access to the server.
&lt;br /&gt;
&lt;br /&gt;

The 'sysreq' shortcuts are available from the console of your server. The commands can be given by pressing Ctrl and “o” (as Oscar) in order to enter the &lt;strong&gt;sysreq mode&lt;/strong&gt;, and then you can enter the command. By doing this, you can stop all the processes by:
&lt;strong&gt;Ctrl+o +i&lt;/strong&gt; (to kill). &lt;strong&gt;Ctrl+o +h&lt;/strong&gt; gives you quick help to all of the available sysreq commands.
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;3. Your server may be “unreachable” but may nonetheless be working normally, and without any technical problem.&lt;/strong&gt;
&lt;br /&gt;
&lt;br /&gt;
This may happen if your server is the victim of a &lt;strong&gt;DDoS attack&lt;/strong&gt; for example. Your server will therefore be &lt;strong&gt;isolated from the rest of the network&lt;/strong&gt; in order to protect our infrastructure and the quality of service for other customers.
&lt;br /&gt;
&lt;br /&gt;
You may verify whether or not your server is in this state by performing a “&lt;strong&gt;traceroute&lt;/strong&gt;” command on the IP address of your server. If it stops at its arrival at Gandi, on one of our routers for example, it is likely that your server has been isolated from the network. You may then connect to your server via the console, though you will need to contact the support team to correct the problem (they will usually contact you first). This sort of isolation happens only very rarely.
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;After that, if you are still blocked, then this means that you are in the 4th case: your very own case ;-).&lt;/strong&gt; Please send an email to our support team indicating that your server has been blocked, and you will get an answer as soon as possible.</description>
    
    
    
          <comments>http://gandikitchen.net/post/2010/01/13/What-to-do-if-your-server-stops-responding#comment-form</comments>
      <wfw:comment>http://gandikitchen.net/post/2010/01/13/What-to-do-if-your-server-stops-responding#comment-form</wfw:comment>
      <wfw:commentRss>http://gandikitchen.net/feed/rss2/comments/1520</wfw:commentRss>
      </item>
    
  <item>
    <title>How to turn your website into a  &quot;Web Infrastructure&quot;</title>
    <link>http://gandikitchen.net/post/2010/01/13/How-to-turn-your-website-into-a-Web-Infrastructure</link>
    <guid isPermaLink="false">urn:md5:a14a971af01c9d955f26096e4c128eb9</guid>
    <pubDate>Wed, 13 Jan 2010 13:25:00 +0100</pubDate>
    <dc:creator>Ryan</dc:creator>
        <category>Hosting</category>
            
    <description>Many websites start with a single server solution, a box acting as a web server and database server all in one. Simply, easy, cheap. The problem comes when traffic gets too high (a victim of their own success!). Many customers want a bigger box, but the answer is actually changing your architecture from &amp;quot;web server&amp;quot; to &amp;quot;web infrastructure&amp;quot;. You can duplicate web servers, use the DNS to load balance them and ramp up your capacity very fast and very far.&lt;br /&gt;&lt;a href=&quot;http://www.gandi.net/hosting&quot;&gt;&lt;/a&gt;    &lt;br /&gt;For simplicity's sake, let's take a real example.  As some of you already know, we support the
&lt;a href=&quot;http://www.millenium.org/&quot;&gt;Millenium&lt;/a&gt; association in their promotion of online video games.
&lt;br /&gt;
&lt;br /&gt;
The increasing success of the website, &lt;a href=&quot;http://www.millenium.org/&quot;&gt;millenium.org&lt;/a&gt;, made us re-design the architecture of the
website so that it could handle the numerous videos shown on the website to its 17,000 unique visitors per day far more easily and efficiently.&lt;br /&gt;
&lt;br /&gt;
Following a major update of one of the games served by Millenium (WOW patch 3.1), we increased the server power to 16 shares in anticipation of an increase in load. Our expectations were quickly exceeded with over &lt;strong&gt;50,000 unique visitors the first day&lt;/strong&gt;, and just as many over the following days.
&lt;br /&gt;
&lt;br /&gt;
The website received between 500 and 1,000 simultaneous visitors and a large number of videos,  which is not viable for a single LAMP server. We immediately changed the infrastructure, by moving from a unique-server model (which is often the starting choice) to an
infrastructure-based model. We went from a &lt;strong&gt;vertical system&lt;/strong&gt; (more power) to a &lt;strong&gt;horizontal system&lt;/strong&gt; (more
servers):
&lt;br /&gt;
&lt;img src=&quot;http://gandikitchen.net/public/archidnsrobin-en.gif&quot; alt=&quot;archidnsrobin-en.gif&quot; style=&quot;margin: 0 auto; display: block;&quot; title=&quot;archidnsrobin-en.gif, May 2009&quot; /&gt;
&lt;br /&gt;
As you can see in the diagram, we moved the database to a separate server and duplicated the web
server to two machines. The load was therefore split by the domain's DNS (using a simple &lt;a href=&quot;http://en.wikipedia.org/wiki/Round_robin_DNS&quot; hreflang=&quot;en&quot;&gt;DNS round robin&lt;/a&gt; technique). We could also move to
dedicating a 1-share server to load distribution, though such a solution would take a bit longer to
implement. In our case it took 2 minutes to add the shares to the account, 6 minutes to create the 2
servers, 10 minutes to transfer the data, and 2 hours to configure the services.
&lt;br /&gt;
&lt;br /&gt;
Today, the platform easily handles 1 million unique visitors per month, for over 3 million pages
viewed - a good thing! Best of all &lt;strong&gt;the platform is now capable of
evolving&lt;/strong&gt;. If the database suffers, all we need to do is to add more shares to the database server.
If the web front starts to become saturated, we just need to add another.
&lt;br /&gt;&lt;br /&gt;
Because our cloud infrastructure allows you to create as many servers as you want from the hosting resources in your account, you can always add more, and always change your web architecture without replacing physical servers. The&lt;a href=&quot;http://www.gandi.net/hosting&quot;&gt; VPS hosting&lt;/a&gt; system is flexible and allows you to increase from a 1-share server (1/64 of a machine + 1/64 as reserve, 256MB of Ram) to a 16-share server (1/4 of a machine + 1/4 as a reserve, 4GB de Ram) at any time and as often as you want.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you find yourself confronted by this type of problem, please feel free to contact us, as we would
be more than happy to help you.
&lt;br /&gt;&lt;br /&gt;Gandi Hosting Team&lt;br /&gt;</description>
    
    
    
          <comments>http://gandikitchen.net/post/2010/01/13/How-to-turn-your-website-into-a-Web-Infrastructure#comment-form</comments>
      <wfw:comment>http://gandikitchen.net/post/2010/01/13/How-to-turn-your-website-into-a-Web-Infrastructure#comment-form</wfw:comment>
      <wfw:commentRss>http://gandikitchen.net/feed/rss2/comments/1519</wfw:commentRss>
      </item>
    
</channel>
</rss>