{"id":189558,"date":"2016-11-28T13:57:15","date_gmt":"2016-11-28T11:57:15","guid":{"rendered":"http:\/\/mybroadband.co.za\/news\/?p=189558"},"modified":"2016-11-28T13:58:32","modified_gmt":"2016-11-28T11:58:32","slug":"how-raru-stayed-online-during-black-friday","status":"publish","type":"post","link":"https:\/\/mybroadband.co.za\/news\/internet\/189558-how-raru-stayed-online-during-black-friday.html","title":{"rendered":"How Raru stayed online during Black Friday"},"content":{"rendered":"<p>Black Friday took a toll on South Africa&#8217;s online retailers, with many suffering downtime or problems with\u00a0payment processing systems.<\/p>\n<p>Raru was one of the online retailers that kept its site up throughout the day &#8211; barring two minutes in the early morning &#8211; without\u00a0needing to switch to a bigger server.<\/p>\n<p>&#8220;Raru is a lean start-up and buying millions of rand of stock for a single day adds risk. If\u00a0our\u00a0site is down it would take much longer to sell that stock and cash flow is critical,&#8221; it said.<\/p>\n<p>It said its site\u00a0is running on a single mid-range server and a second server is used as a replicated failover backup.<\/p>\n<h3 class=\"my-4\">Operating system upgrade<\/h3>\n<p>To ensure everything ran optimally for Black Friday, the latest version of Ubuntu Linux,\u00a0which includes an upgrade to PHP 7, was installed.<\/p>\n<p>This gave Raru a 130% increase in performance under load. The Ubuntu upgrade also came with the latest versions of Nginx and MySQL.<\/p>\n<p>As part of the upgrade, it also rolled out HTTPS across the entire site.<\/p>\n<p>&#8220;Customers&#8217; payment and personal details were always protected, and switching the entire site means nobody in the middle can eavesdrop on what they are browsing either.&#8221;<\/p>\n<h3 class=\"my-4\">Handling the spikes<\/h3>\n<p>Raru&#8217;s big sales see new products appearing at regular intervals, which causes spikes in traffic at those intervals.<\/p>\n<p>During its second birthday sale, Raru found that the\u00a0concurrent connections at the spikes were approaching the limits that Nginx could handle on its hardware. To mitigate this it:<\/p>\n<ul>\n<li>Switched to HTTP\/2. The\u00a0new protocol reduces the number of connections your browser makes to the server and fetches multiple images and scripts on a single connection.<\/li>\n<li>Load balanced to serve images from failover server as load gets bigger.<\/li>\n<li>Run more SQL queries from the slave database on the failover server should\u00a0the need arise.<\/li>\n<li>Have the option to switch off images on the deals page in the case of total overload. This is not ideal, but better than downtime.<\/li>\n<\/ul>\n<h3 class=\"my-4\">Some\u00a0downtime<\/h3>\n<p>Raru&#8217;s only downtime on the day was between 08:00 and 08:02.<\/p>\n<p>Many people were refreshing the site at the same time, causing the database to update the new prices and deals on the products, which pushed the site beyond the one-minute timeout.<\/p>\n<p>A two-minute timeout would&#8217;ve prevented the downtime.<\/p>\n<p>Its customers also experienced problems\u00a0paying by credit card, but Raru said this wasn&#8217;t under its control.<\/p>\n<p>&#8220;With the huge volume of transactions countrywide, the company that handles 3D Secure for credit cards couldn&#8217;t cope and many people were unable to complete their card payments.&#8221;<\/p>\n<p>Raru said it offered alternative payment methods and let clients try\u00a0their card\u00a0later after they had secured the items they wanted.<\/p>\n<h3 class=\"my-4\">The stats<\/h3>\n<p>Raru provided the following statistics from\u00a0Black Friday:<\/p>\n<ul>\n<li>Page views doubled compared to Black Friday 2015.<\/li>\n<li>Page views were up 700% compared to an average November day.<\/li>\n<li>100% growth in turnover compared to last Black Friday.<\/li>\n<li>Turnover was up 1,100% compared to an average November day.<\/li>\n<li>Uptime of 99.8%.<\/li>\n<li>Peak of 20,000 concurrent connections.<\/li>\n<li>Peak of 6,000 web-server requests per second.<\/li>\n<li>Peak CPU usage was 38% for 5 minutes at 8am. Average usage was 18%.<\/li>\n<\/ul>\n<h3 class=\"my-4\">Now read:\u00a0<a href=\"http:\/\/mybroadband.co.za\/news\/gadgets\/188958-best-cyber-monday-2016-tech-deals-in-south-africa.html\">Best Cyber Monday 2016 tech deals in South Africa<\/a><\/h3>\n","protected":false},"excerpt":{"rendered":"<p>Raru reveals what it did to make sure its website remained online throughout Black Friday.<\/p>\n","protected":false},"author":23,"featured_media":149173,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_sma_x_autopost_status":"idle","_sma_x_autopost_error":"","_sma_x_post_id":"","_sma_facebook_post_id":"","_sma_instagram_post_id":"","_sma_threads_post_id":"","_sma_x_attempts":0,"footnotes":""},"categories":[18],"tags":[35,25321],"class_list":["post-189558","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-internet","tag-headline","tag-raru"],"_links":{"self":[{"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/posts\/189558"}],"collection":[{"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/users\/23"}],"replies":[{"embeddable":true,"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/comments?post=189558"}],"version-history":[{"count":2,"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/posts\/189558\/revisions"}],"predecessor-version":[{"id":189620,"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/posts\/189558\/revisions\/189620"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/media\/149173"}],"wp:attachment":[{"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/media?parent=189558"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/categories?post=189558"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/tags?post=189558"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}