{"id":916,"date":"2016-06-08T10:59:44","date_gmt":"2016-06-08T10:59:44","guid":{"rendered":"http:\/\/cloudkul.com\/blog\/?p=916"},"modified":"2017-06-14T11:34:03","modified_gmt":"2017-06-14T11:34:03","slug":"server-autoscaling-aws","status":"publish","type":"post","link":"https:\/\/cloudkul.com\/blog\/server-autoscaling-aws\/","title":{"rendered":"Server Autoscaling on AWS"},"content":{"rendered":"<p>Today we discuss about the best scaling mechanism for the production server. There are two types of scaling which we can inherit either Horizontal Scaling or Vertical Scaling.<\/p>\n<p>In Horizontal Scaling we can add more servers to our pool of resources and make them distribute the load accordingly but In Vertical Scaling we have to increase the computational or memory power of the single machine to handle the load more efficiently. Horizontal Scaling is more efficient and economic as compared to the Vertical Scaling because in Horizontal Scaling we can increase or decrease the pool of resources in real time without any downtime or affecting the services which is not possible in Vertical Scaling. So, we always prefer horizontal scaling for our production or live server environment.<\/p>\n<p>Lets implement the auto scaling (Automatic Horizontal Scaling) on AWS.<\/p>\n<p><strong>To implement\u00a0auto scaling\u00a0on your application, you have to take care of few things which are as follows-:<\/strong><\/p>\n<ul>\n<li>Application and Database should be on separate servers so that we can clone our application server as per demand and it doesn&#8217;t affect our central database, for database server we can use RDS Service of AWS (Required).<\/li>\n<li>All dynamic files (files created at the time of code execution for ex-: images, thumbnails, templates etc.) should be stored and managed through S3 or any other Central Storage Media so that all servers can access these files irrespective of their life cycle (Required).<\/li>\n<li>We can setup GIT or SVN on the application server for Updating and Maintaining the code structure throughout the server pool (Recommended).<\/li>\n<li>Load Balancer is required to balance the load between the pool of servers (Required).<\/li>\n<li>Load Balancer, Database Server, Application Server and Auto scaling group should be in the same VPC (Required).<\/li>\n<li>Create AMI image of your application server to setup launch configuration of autoscaling(Required).<\/li>\n<\/ul>\n<p><strong>First we have to create a load balancer as follows-:<\/strong><\/p>\n<ol>\n<li>After logged into AWS Console go to EC2 Panel and select load balancer.<\/li>\n<li>\u00a0Click \u201cCreate Load Balancer\u201d button.<\/li>\n<li>Type Load Balancer name, Select the same VPC and subnet in which your application and database servers are present and setup the listener configuration as per your choice either on port 80,443 or both.<\/li>\n<li>Select an existing Security Group or Create a new one in the same VPC and subnet.<\/li>\n<li>Configure health check on the load balancer either on TCP port basis or webpage basis, for more details refer to AWS Documents for Load Balancer.<\/li>\n<li>Add EC2 instance (Application Server) in the load balancer.<\/li>\n<li>Add Tags and Review all your settings in the next window, after reviewing all the settings launch the load balancer.<\/li>\n<\/ol>\n<p><strong>As we have already added one EC2 instance (Application Server) in our Load Balancer, now we have to enable the\u00a0auto scaling\u00a0by following steps.<\/strong><\/p>\n<ol>\n<li>After logged into AWS Console go to EC2 Panel and select \u201cLaunch Configuration\u201d in \u201cAuto Scaling\u201d pane.<\/li>\n<li>Click \u201cCreate Auto Scaling Group\u201d and then click on \u201cCreate Launch Configuration\u201d.<\/li>\n<li>In the next step choose your application server AMI which you have created for launch configuration.<\/li>\n<li>In next step choose the instance type and fill the launch configuration details like name, IAM role and other advanced details or you can make it simple by giving name only.<\/li>\n<li>In the next step all the storage volume and set the storage space for instances.<\/li>\n<li>Now create or select the security group but you have to take care that these security groups should be the member of same VPC group in which application and database server are present.<\/li>\n<li>After that review your configuration and launch the configuration in next step.<\/li>\n<li>Now in the \u201cConfigure Auto Scaling group details\u201d pane type the group name for auto scaling group and set the initial size of the group by giving size in \u201cGroup size\u201d, In \u201cNetwork\u201d drop down list and \u201cAvailability Zone\u201d select your same VPC and Zones respectively.<\/li>\n<li>In Advanced Details select your load balancer which you have created before and enter the \u201cHealth Check Grace Period\u201d.<\/li>\n<li>Now configure the scaling policies as per your requirement either on CPU consumption, Memory Consumption or based on traffic for more details please check <a href=\"http:\/\/docs.aws.amazon.com\/autoscaling\/latest\/userguide\/policy_creating.html\">here<\/a>\u00a0or you can select the keep this group at its initial size.<\/li>\n<li>After that skip the notification part and give the tags to your auto scaled instances.<\/li>\n<li>Review your configuration in the next step and create the auto scaling group.<\/li>\n<\/ol>\n<p><strong>After this go to your EC2 instance panel and check for launched instances which will be managed on the basis of your scaling policy and you don&#8217;t need any manual scaling for extra traffic.<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/cloudkul.com\/contact\/\">IN CASE OF ANY QUERY, CONTACT US<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today we discuss about the best scaling mechanism for the production server. There are two <a class=\"text-primary\" title=\"read more\" href=\"https:\/\/cloudkul.com\/blog\/server-autoscaling-aws\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":6,"featured_media":920,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[32,2],"tags":[41,16,42],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Server Autoscaling on AWS - Cloudkul<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/cloudkul.com\/blog\/server-autoscaling-aws\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Server Autoscaling on AWS - Cloudkul\" \/>\n<meta property=\"og:description\" content=\"Today we discuss about the best scaling mechanism for the production server. There are two [...]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/cloudkul.com\/blog\/server-autoscaling-aws\/\" \/>\n<meta property=\"og:site_name\" content=\"Cloudkul\" \/>\n<meta property=\"article:published_time\" content=\"2016-06-08T10:59:44+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-06-14T11:34:03+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2016\/06\/Autoscaling-on-AWS.png\" \/>\n\t<meta property=\"og:image:width\" content=\"848\" \/>\n\t<meta property=\"og:image:height\" content=\"422\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Nitin Agnihotri\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/cloudkul.com\/blog\/server-autoscaling-aws\/\",\"url\":\"https:\/\/cloudkul.com\/blog\/server-autoscaling-aws\/\",\"name\":\"Server Autoscaling on AWS - Cloudkul\",\"isPartOf\":{\"@id\":\"https:\/\/cloudkul.com\/blog\/#website\"},\"datePublished\":\"2016-06-08T10:59:44+00:00\",\"dateModified\":\"2017-06-14T11:34:03+00:00\",\"author\":{\"@id\":\"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/2891deba97a03939d99419a3ac3407a4\"},\"breadcrumb\":{\"@id\":\"https:\/\/cloudkul.com\/blog\/server-autoscaling-aws\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/cloudkul.com\/blog\/server-autoscaling-aws\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/cloudkul.com\/blog\/server-autoscaling-aws\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/cloudkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Server Autoscaling on AWS\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/cloudkul.com\/blog\/#website\",\"url\":\"https:\/\/cloudkul.com\/blog\/\",\"name\":\"Cloudkul\",\"description\":\"Host your eCommerce Store on AWS with Optimized Performance\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/cloudkul.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/2891deba97a03939d99419a3ac3407a4\",\"name\":\"Nitin Agnihotri\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/78eef67ca93349ba049e7db9e3481aa9?s=96&d=https%3A%2F%2Fs.gravatar.com%2Favatar%2F6148c37469011bc2f8e491ca8f5de495%3Fs%3D80&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/78eef67ca93349ba049e7db9e3481aa9?s=96&d=https%3A%2F%2Fs.gravatar.com%2Favatar%2F6148c37469011bc2f8e491ca8f5de495%3Fs%3D80&r=g\",\"caption\":\"Nitin Agnihotri\"},\"url\":\"https:\/\/cloudkul.com\/blog\/author\/nitin124\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Server Autoscaling on AWS - Cloudkul","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/cloudkul.com\/blog\/server-autoscaling-aws\/","og_locale":"en_US","og_type":"article","og_title":"Server Autoscaling on AWS - Cloudkul","og_description":"Today we discuss about the best scaling mechanism for the production server. There are two [...]","og_url":"https:\/\/cloudkul.com\/blog\/server-autoscaling-aws\/","og_site_name":"Cloudkul","article_published_time":"2016-06-08T10:59:44+00:00","article_modified_time":"2017-06-14T11:34:03+00:00","og_image":[{"width":848,"height":422,"url":"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2016\/06\/Autoscaling-on-AWS.png","type":"image\/png"}],"author":"Nitin Agnihotri","twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/cloudkul.com\/blog\/server-autoscaling-aws\/","url":"https:\/\/cloudkul.com\/blog\/server-autoscaling-aws\/","name":"Server Autoscaling on AWS - Cloudkul","isPartOf":{"@id":"https:\/\/cloudkul.com\/blog\/#website"},"datePublished":"2016-06-08T10:59:44+00:00","dateModified":"2017-06-14T11:34:03+00:00","author":{"@id":"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/2891deba97a03939d99419a3ac3407a4"},"breadcrumb":{"@id":"https:\/\/cloudkul.com\/blog\/server-autoscaling-aws\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/cloudkul.com\/blog\/server-autoscaling-aws\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/cloudkul.com\/blog\/server-autoscaling-aws\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/cloudkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Server Autoscaling on AWS"}]},{"@type":"WebSite","@id":"https:\/\/cloudkul.com\/blog\/#website","url":"https:\/\/cloudkul.com\/blog\/","name":"Cloudkul","description":"Host your eCommerce Store on AWS with Optimized Performance","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/cloudkul.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/2891deba97a03939d99419a3ac3407a4","name":"Nitin Agnihotri","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/78eef67ca93349ba049e7db9e3481aa9?s=96&d=https%3A%2F%2Fs.gravatar.com%2Favatar%2F6148c37469011bc2f8e491ca8f5de495%3Fs%3D80&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/78eef67ca93349ba049e7db9e3481aa9?s=96&d=https%3A%2F%2Fs.gravatar.com%2Favatar%2F6148c37469011bc2f8e491ca8f5de495%3Fs%3D80&r=g","caption":"Nitin Agnihotri"},"url":"https:\/\/cloudkul.com\/blog\/author\/nitin124\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/posts\/916"}],"collection":[{"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/comments?post=916"}],"version-history":[{"count":7,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/posts\/916\/revisions"}],"predecessor-version":[{"id":924,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/posts\/916\/revisions\/924"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/media\/920"}],"wp:attachment":[{"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/media?parent=916"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/categories?post=916"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/tags?post=916"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}