{"id":59061,"date":"2023-10-09T16:14:58","date_gmt":"2023-10-09T10:44:58","guid":{"rendered":"https:\/\/www.tothenew.com\/blog\/?p=59061"},"modified":"2023-11-03T16:26:36","modified_gmt":"2023-11-03T10:56:36","slug":"dos-and-donts-to-keep-in-mind-while-migrating-to-graviton","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/dos-and-donts-to-keep-in-mind-while-migrating-to-graviton\/","title":{"rendered":"Dos and Don&#8217;ts to keep in mind while migrating to Graviton"},"content":{"rendered":"<h3><strong>About AWS Graviton<\/strong><\/h3>\n<p>AWS Graviton is the ARM-based processor designed by AWS to provide high performance at a lower cost compared to the Intel x64-based processor. As you have experienced with software like WhatsApp, we have often received upgrade notifications that bring various improvements such as enhanced performance, new features, and bug fixes from the previous versions. Similarly, AWS offers three generations of Graviton processors, each building on the success of previous ones. The first generation, Graviton, introduced limited resource support. We saw an upgraded version, Graviton2, which brought special Neoverse cores, a huge cache, and a hardware accelerator. This upgrade significantly boosted the performance. Many AWS services like AWS Fargate, AWS lambda, and AWS EMR now support AWS Graviton Processors. Now, let\u2019s talk about our latest Graviton3 offering, which offers up to 25% better computing performance and 2 times faster than our previous offering.<\/p>\n<h3>Why are Organizations planning to switch their workload to AWS Graviton?<\/h3>\n<p><strong>Finding 1<\/strong>: As you can see below, I have checked the hourly cost of our current workload instance type i.e. (m3.xlarge), and compared it with the graviton alternate Instance type, We have found a cheap price in the graviton instance. The tool used to access the cost difference is \u2192 https:\/\/instances.vantage.sh\/<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignleft wp-image-58940\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/10\/1-1.png\" alt=\"https:\/\/instances.vantage.sh\/\" width=\"857\" height=\"363\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2023\/10\/1-1.png 850w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/1-1-300x127.png 300w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/1-1-768x325.png 768w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/1-1-624x264.png 624w\" sizes=\"(max-width: 857px) 100vw, 857px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Test Case 1<\/strong>: I have launched two instances, one using t4g.micro and the other using t2.micro, in order to evaluate CPU Usage and the performance difference between the graviton-based instance and the intel-based one. Ruined the below script to increase the CPU load on both instances, Before running make sure you have installed stress-ng in your system.<\/p>\n<h4>On the Debian distribution, run the below command:<br \/>\n<strong>&#8211; apt-get install stress-ng<\/strong><\/h4>\n<pre><span style=\"font-weight: 400;\">#!\/bin\/bash<\/span>\r\n<span style=\"font-weight: 400;\"># Define the number of CPU stress workers<\/span>\r\n<span style=\"font-weight: 400;\">CPU_WORKERS=$(nproc)<\/span>\r\n<span style=\"font-weight: 400;\"># Generate CPU load<\/span>\r\n<span style=\"font-weight: 400;\">stress-ng --cpu $CPU_WORKERS --timeout 60s<\/span>\r\n<span style=\"font-weight: 400;\"># Clean up \u2013 To Stop Stress<\/span>\r\n<span style=\"font-weight: 400;\">stress-ng --cpu 0 --timeout 10s<\/span><\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignleft size-full wp-image-58941\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/10\/2.png\" alt=\"\" width=\"850\" height=\"360\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2023\/10\/2.png 850w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/2-300x127.png 300w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/2-768x325.png 768w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/2-624x264.png 624w\" sizes=\"(max-width: 850px) 100vw, 850px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignleft wp-image-59056\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/10\/1.1-1.png\" alt=\"\" width=\"856\" height=\"893\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2023\/10\/1.1-1.png 445w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/1.1-1-288x300.png 288w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/1.1-1-24x24.png 24w\" sizes=\"(max-width: 856px) 100vw, 856px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignleft wp-image-59057\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/10\/4-2.png\" alt=\"\" width=\"858\" height=\"177\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2023\/10\/4-2.png 698w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/4-2-300x62.png 300w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/4-2-624x129.png 624w\" sizes=\"(max-width: 858px) 100vw, 858px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignleft wp-image-59058\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/10\/5-2.png\" alt=\"\" width=\"855\" height=\"114\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2023\/10\/5-2.png 698w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/5-2-300x40.png 300w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/5-2-624x83.png 624w\" sizes=\"(max-width: 855px) 100vw, 855px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><b>Test Case 2: <\/b><span style=\"font-weight: 400;\">We tested load testing on t3.micro and t4g.micro instances, which have the same CPU and Memory. Over the past hour, we found graviton instances perform better, even though they cost about 20% less. So, if we don\u2019t need more CPU and memory, we can save money by switching to graviton instances with similar performance. Below is the graph of CPU utilization for the last 1 hour for reference.<\/span><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignleft wp-image-59059\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/10\/6-2.png\" alt=\"\" width=\"858\" height=\"160\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2023\/10\/6-2.png 697w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/6-2-300x56.png 300w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/6-2-624x116.png 624w\" sizes=\"(max-width: 858px) 100vw, 858px\" \/><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignleft wp-image-59060\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/10\/8-2.png\" alt=\"\" width=\"858\" height=\"379\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2023\/10\/8-2.png 790w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/8-2-300x133.png 300w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/8-2-768x339.png 768w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/8-2-624x276.png 624w\" sizes=\"(max-width: 858px) 100vw, 858px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h3><\/h3>\n<h3><b>Summing Up Test Results and Findings<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">After executing the bash script, we noticed that the t4g.micro instance performed better with 2 cores compared to the t2.micro instance core. The CPU Utilization graph clearly illustrates this after load testing with stress-ng. What\u2019s more, there\u2019s a 20% cost difference between both instances. These results show that AWS Graviton Instances provide better performance at a lower cost and in the second test case, the Graviton instance(t4g.micro) performs slightly better. It costs 20% less than t3.micro with a similar CPU and memory. Switching to Graviton is a cost-effective choice for comparable performance. That\u2019s why Organizations are now moving their workload to AWS Graviton. Now let\u2019s discuss what we must remember while migrating our workloads to AWS Graviton.<\/span><\/p>\n<h3><b>Perform Load Testing of your Workload<\/b><\/h3>\n<h4><span style=\"text-decoration: underline;\"><b>Dos :<\/b><\/span><\/h4>\n<ul>\n<li><span style=\"font-weight: 400;\">As you can observe, I conducted a CPU load-testing using stress-ng to monitor the behavior and performance of the graviton instance. Same when you are planning to migrate workload to graviton make sure you do the load testing of the environment using tools like Apache Benchmark and Jmeter. This will help you to determine whether opting for a more compute-oriented instance type is necessary or not and how the graviton instances handle the traffic load. Then decide whether to proceed with graviton or not.<\/span><\/li>\n<\/ul>\n<h4><span style=\"text-decoration: underline;\"><b>Don\u2019t:<\/b><\/span><\/h4>\n<ul>\n<li><span style=\"font-weight: 400;\">blindly migrate your infrastructure without assessing your workload load, especially when planning to roll this out on your production workload. You need to be extra cautious, and if instances are unable to deliver the expected performance, you should have a rollback plan ready. In a production environment, we don&#8217;t have much time to test and troubleshoot issues.<\/span><\/li>\n<\/ul>\n<h3><b>Monitor your Workload<\/b><\/h3>\n<h4><span style=\"text-decoration: underline;\"><b>Dos:<\/b><\/span><\/h4>\n<ul>\n<li><span style=\"font-weight: 400;\">After migrating your workload to Graviton, keep an eye on performance metrics such as CPU Utilization, Memory Utilization, DiskI\/O, and Network Traffic using a Monitoring tool like AWS Cloudwatch or Newrelic.<\/span><\/li>\n<\/ul>\n<h4><span style=\"text-decoration: underline;\"><b>Don\u2019t:<\/b><\/span><\/h4>\n<ul>\n<li><span style=\"font-weight: 400;\">Benchmarking your workload must not be avoided. While It may promise cost savings and good performance, your workload\u2019s performance may vary.<\/span><\/li>\n<\/ul>\n<h3><b>Do Cross Compile of your Dockerfile<\/b><\/h3>\n<h4><span style=\"text-decoration: underline;\"><b>Dos:<\/b><\/span><\/h4>\n<ul>\n<li><span style=\"font-weight: 400;\">Choose<\/span> <span style=\"font-weight: 400;\">a<\/span> <span style=\"font-weight: 400;\">multiplatform base image that supports both x86 and Arm64 architectures. Build on both types of architecture. As technology evolves, we see new types of processors like AWS\u2019s Graviton which are cheaper and faster. To make our work easier, we can use multi-platform docker images. These images work on different types of processors without changing our Dockerfile each time. It is like having one-size-fits-all containers that can run on different types of OS so build and test on arm and x86 type of processor.<\/span><\/li>\n<\/ul>\n<p><span style=\"text-decoration: underline;\"><b>Don\u2019t :<\/b><\/span><\/p>\n<ul>\n<li><span style=\"font-weight: 400;\">Skip updating the dockerfile, as it\u2019s essential for compatibility. adopting a multi-platform Dockerfile approach will modify the way we build our Dockerfile, so be sure to update your build strategy in your existing deployment scripts.<\/span><\/li>\n<\/ul>\n<h3><b>Do Optimize your code<\/b><\/h3>\n<h4><span style=\"text-decoration: underline;\"><b>Dos:<\/b><\/span><\/h4>\n<ul>\n<li><span style=\"font-weight: 400;\">Create a Documentation or checklist to verify code package compatibility with ARM-based processors and note any issue you have encountered during the transition to graviton processors.<\/span><\/li>\n<\/ul>\n<h4><span style=\"text-decoration: underline;\"><b>Don\u2019t:<\/b><\/span><\/h4>\n<ul>\n<li><span style=\"font-weight: 400;\">Continuous optimization must not be ignored. Regularly revisit your code and fine-tune your code as a new ARM-Processor and optimization techniques emerge.<\/span><\/li>\n<\/ul>\n<h3><b>Do Consider Cost Savings<\/b><\/h3>\n<h4><span style=\"text-decoration: underline;\"><b>Dos:<\/b><\/span><\/h4>\n<ul>\n<li><span style=\"font-weight: 400;\">Calculate potential cost savings based on your workload performance requirements to see if graviton instances are cost-effective choices.<\/span><\/li>\n<\/ul>\n<h4><span style=\"text-decoration: underline;\"><b>Don\u2019t:<\/b><\/span><\/h4>\n<ul>\n<li><span style=\"font-weight: 400;\">Avoid compromising your workload\u2019s performance solely for cost saving. As demonstrated in our CPU load testing and observed a sudden spike at a current point in time. We found that Graviton initially exhibited higher utilization compared to x86, but after some time, they performed better under normal workload than x86 instances. Therefore, It\u2019s advisable to monitor performance over several days to determine if graviton processors are suitable for your workload or not. \u00a0<\/span><\/li>\n<\/ul>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignleft wp-image-59060\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/10\/8-2.png\" alt=\"\" width=\"833\" height=\"368\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2023\/10\/8-2.png 790w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/8-2-300x133.png 300w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/8-2-768x339.png 768w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/8-2-624x276.png 624w\" sizes=\"(max-width: 833px) 100vw, 833px\" \/><\/p>\n<h3><\/h3>\n<h3><b>Check the compatibility of running software<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">When migrating your current workload to AWS Graviton instances, especially when you have a mix of microservices and standalone servers running various applications like Pritunl, Jenkins, ELK, and Grafana. It\u2019s essential to approach compatibility assessment carefully.<\/span><\/p>\n<h4><span style=\"text-decoration: underline;\"><b>Dos:<\/b><\/span><\/h4>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Conduct a comprehensive assessment of your application landscape. Categorize applications into microservices and standalone servers, identifying their specific compatibility requirements.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Keep detailed documents of steps taken to migrate your standalone application to Graviton standalone servers. Including version compatibility, and steps involved in setting up applications onto graviton instances. Also, mention the challenges you have faced while setting arm-based applications. Such as configuring the pritunl server or grafana instances on the graviton server and specifying compatibility requirements.<\/span><\/li>\n<\/ul>\n<h4><span style=\"text-decoration: underline;\"><b>Don\u2019t:<\/b><\/span><\/h4>\n<ul>\n<li><span style=\"font-weight: 400;\">Don\u2019t forget to backup your standalone applications before migrating to Graviton. This precaution is essential in case unexpected issues arise after migrating the production workload to Graviton.<\/span><\/li>\n<\/ul>\n<h2><b>Conclusion\u00a0<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">Migrating workload to AWS Graviton can be a strategic move to achieve cost savings and improved performance. It\u2019s crucial to recognize that some services are easier to migrate than others. For instance, migrating a database to Graviton provides cost benefits without much effort. You can also see not much cost difference in graviton smaller instances but when you are planning to switch to higher instances type, it will provide you 100% cost saving and better performance. Verify flawless operation, confirm dependencies, and adapt for ARM-64. While Graviton offers cost-efficiency and performance, diligence in balancing cost and compatibility is crucial.<\/span><\/p>\n<div class=\"ap-custom-wrapper\"><\/div><!--ap-custom-wrapper-->","protected":false},"excerpt":{"rendered":"<p>About AWS Graviton AWS Graviton is the ARM-based processor designed by AWS to provide high performance at a lower cost compared to the Intel x64-based processor. As you have experienced with software like WhatsApp, we have often received upgrade notifications that bring various improvements such as enhanced performance, new features, and bug fixes from the [&hellip;]<\/p>\n","protected":false},"author":1435,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":154},"categories":[4308,2348],"tags":[5320],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/59061"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/1435"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=59061"}],"version-history":[{"count":2,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/59061\/revisions"}],"predecessor-version":[{"id":59356,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/59061\/revisions\/59356"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=59061"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=59061"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=59061"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}