{"id":112169,"date":"2016-11-28T11:01:09","date_gmt":"2016-11-28T09:01:09","guid":{"rendered":"https:\/\/mygaming.co.za\/news\/?p=112169"},"modified":"2016-11-28T11:02:35","modified_gmt":"2016-11-28T09:02:35","slug":"raru-reveals-the-incredible-numbers-behind-its-black-friday","status":"publish","type":"post","link":"https:\/\/mygaming.co.za\/news\/business\/112169-raru-reveals-the-incredible-numbers-behind-its-black-friday","title":{"rendered":"Raru reveals the incredible numbers behind its Black Friday Sale"},"content":{"rendered":"<p>While it&#8217;s immediately clear from the vast coverage and immense site traffic how popular Black Friday is in South Africa, it doesn&#8217;t automatically equate to thousands of sales.<\/p>\n<p>For\u00a0a company\u00a0like <strong><a href=\"https:\/\/raru.co.za\/\" target=\"_blank\">Raru<\/a><\/strong>, buying millions of Rands of stock for a single day adds risk.<\/p>\n<p>The vast amount of traffic could result in possible downtime for the site, meaning\u00a0it would take much longer to sell that stock.<\/p>\n<p>While the folks at Raru expected twice the traffic as last year, upgrading hardware wasn&#8217;t an option &#8211; so how did they do it?<\/p>\n<p>It helps that the site is primarily automated, but with prices and stocks changing by the second, the technical team had to be prepared for the increased traffic well in advance.<\/p>\n<p>Raru&#8217;s <strong>Renier Crause<\/strong> revealed how they kept the site up during the madness.<\/p>\n<h3 class=\"my-4\"><strong>The Technical<\/strong><\/h3>\n<p>First Raru\u00a0upgraded to the latest version of Ubuntu Linux, which includes an upgrade to PHP 7.<\/p>\n<p>The site&#8217;s\u00a0benchmarks showed that this gave it a 130% increase in performance under load. The Ubuntu upgrade also resulted in\u00a0the latest versions of Nginx and MySQL.<\/p>\n<p>The database was stress-tested and many configuration settings were adjusted for the site&#8217;s specific hardware and expected load.<\/p>\n<p>Because of the way Raru\u00a0runs its big deal event days, with new products appearing at regular intervals, this causes extreme spikes in traffic at those intervals as many people are refreshing their\u00a0browsers at the same time.<\/p>\n<p>For example, on Raru&#8217;s 2nd birthday sale, the concurrent connections at the spike were approaching the limits that Nginx could handle on the site&#8217;s\u00a0hardware.<\/p>\n<p>To mitigate this Raru\u00a0implemented the following:<\/p>\n<ul>\n<li>\u00a0Switched to HTTP\/2. This new protocol reduces the number of connections your browser makes to the server and fetches multiple images and scripts on a single connection. This increases performance for the user and reduces concurrent connections on the server.<\/li>\n<li>Load balanced to serve images from their fail-over server as load gets bigger.<\/li>\n<li>Run increasingly more SQL queries from their slave database on the fail-over server should the need arise.<\/li>\n<li>Have the option to switch off some images on the deals page in the case of total overload. This is not ideal, but better than total downtime. Fortunately this was never needed.<\/li>\n<\/ul>\n<h3 class=\"my-4\"><strong>On the day<\/strong><\/h3>\n<p>At 06:00 it was already clear traffic was going to be big.<\/p>\n<p>By 07:00 Raru was\u00a0already past a normal day&#8217;s peak traffic even though its\u00a0Black Friday deals only started at 08:00.<\/p>\n<p>At 8:01am the site went down, only to reappear at 8:02am.\u00a0With so many people refreshing at the same time, the database was having to update the new prices and deals on the products which pushed the site beyond its one minute timeout. If it used a two minute timeout, there would have been no downtime.<\/p>\n<p>The site&#8217;s big deals sold out in minutes. As a result, Raru went past an\u00a0average day&#8217;s turnover in just 14 minutes.<\/p>\n<p>At 10:00 when the next batch of deals came online, some people experienced another timeout but it was only for a minute.<\/p>\n<p>By 11:00\u00a0Raru had passed last year&#8217;s Black Friday total in sales. The site\u00a0broke its all-time record of new customer registrations in a day even though most people pre-registered earlier in the week.<\/p>\n<p>At 15:00\u00a0it had passed its target for the day with still 5 hours to go.<\/p>\n<p>At 20:00\u00a0people were still buying last-minute deals, so Raru\u00a0extended the deals to 22:00.<\/p>\n<p>After Black Friday ended, the site automatically reverted to its normal home page and switched off the black colours.<\/p>\n<h3 class=\"my-4\"><strong>The bad<\/strong><\/h3>\n<p>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 credit card payments.<\/p>\n<p>Fortunately, Raru\u00a0does offer other payment methods and the ability to switch your payment method or retry your card later, after you secured your stock.<\/p>\n<p>By the afternoon, 3D Secure improved and most people could complete their payments, but this meant that they might not have made the cut-off for their purchase to be shipped on Friday.<\/p>\n<h3 class=\"my-4\"><strong>The numbers<\/strong><\/h3>\n<ul>\n<li>Page views were double 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 1100% compared to an average November day.<\/li>\n<li>Total uptime of 99.8% (2 minutes down in total for some people).<\/li>\n<li>Peak of 20,000 concurrent connections (even with HTTP\/2 reducing this a lot)<\/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<p><a href=\"https:\/\/mygaming.co.za\/news\/wp-content\/uploads\/2016\/11\/Black-Friday-2016-technical.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-112173\" src=\"https:\/\/mygaming.co.za\/news\/wp-content\/uploads\/2016\/11\/Black-Friday-2016-technical.jpg\" alt=\"black-friday-2016-technical\" width=\"723\" height=\"196\" \/><\/a><\/p>\n<hr \/>\n<h4>You can catch Raru&#8217;s Cyber Monday deals <strong><a href=\"https:\/\/raru.co.za\/news\/1551-cyber-monday-deals\" target=\"_blank\">here<\/a><\/strong>.<\/h4>\n<h4><strong>Now read:\u00a0<a href=\"https:\/\/mygaming.co.za\/news\/business\/112041-the-confirmed-list-of-south-african-stores-offering-cyber-monday-deals.html\" target=\"_blank\">The confirmed list of South African stores offering Cyber Monday deals<\/a><\/strong><\/h4>\n","protected":false},"excerpt":{"rendered":"<p>Raru has revealed to MyGaming just how big Black Friday was.<\/p>\n","protected":false},"author":234,"featured_media":91629,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_sma_x_autopost_enabled":true,"_sma_x_custom_text":"","_sma_x_autopost_status":"idle","_sma_x_autopost_error":"","_sma_x_post_id":"","_sma_x_attempts":0,"footnotes":""},"categories":[2],"tags":[1197,23461,12541,2163],"class_list":["post-112169","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-business","tag-black-friday","tag-black-monday","tag-raru","tag-south-africa"],"_links":{"self":[{"href":"https:\/\/mygaming.co.za\/news\/wp-json\/wp\/v2\/posts\/112169","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mygaming.co.za\/news\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mygaming.co.za\/news\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mygaming.co.za\/news\/wp-json\/wp\/v2\/users\/234"}],"replies":[{"embeddable":true,"href":"https:\/\/mygaming.co.za\/news\/wp-json\/wp\/v2\/comments?post=112169"}],"version-history":[{"count":2,"href":"https:\/\/mygaming.co.za\/news\/wp-json\/wp\/v2\/posts\/112169\/revisions"}],"predecessor-version":[{"id":112185,"href":"https:\/\/mygaming.co.za\/news\/wp-json\/wp\/v2\/posts\/112169\/revisions\/112185"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/mygaming.co.za\/news\/wp-json\/wp\/v2\/media\/91629"}],"wp:attachment":[{"href":"https:\/\/mygaming.co.za\/news\/wp-json\/wp\/v2\/media?parent=112169"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mygaming.co.za\/news\/wp-json\/wp\/v2\/categories?post=112169"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mygaming.co.za\/news\/wp-json\/wp\/v2\/tags?post=112169"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}