{"id":600,"date":"2019-06-14T21:51:11","date_gmt":"2019-06-14T21:51:11","guid":{"rendered":"http:\/\/www.wis.co.uk\/blog\/?p=600"},"modified":"2019-06-14T21:51:11","modified_gmt":"2019-06-14T21:51:11","slug":"launching-windows-programs-on-aws","status":"publish","type":"post","link":"https:\/\/www.wis.co.uk\/blog\/launching-windows-programs-on-aws","title":{"rendered":"Launching Windows programs on AWS"},"content":{"rendered":"\n<p>A friend of mine is using <a rel=\"noreferrer noopener\" aria-label=\"Studio 2.0 from Bricklink (opens in a new tab)\" href=\"https:\/\/www.bricklink.com\/v3\/studio\/download.page\" target=\"_blank\">Studio 2.0 from Bricklink<\/a> to create digital models in Lego. He is particularly interested in rendering (creating real-looking images of models that only exist in the computer). The models are complex, and include transparent bricks, and his poor home computer isn&#8217;t up to the job. <strong>How difficult is it to run a Windows machine in AWS, to do the rendering &#8220;in the cloud&#8221;? <\/strong><\/p>\n\n\n\n<p>It&#8217;s easy to create Windows instances via the web-based AWS console. <a rel=\"noreferrer noopener\" aria-label=\"This page in the documentation (opens in a new tab)\" href=\"https:\/\/docs.amazonaws.cn\/en_us\/AWSEC2\/latest\/WindowsGuide\/EC2_GetStarted.html\" target=\"_blank\">This page in the documentation<\/a> explains how.  The &#8220;t2.micro&#8221; instance size (1 GiB RAM and 1 vCPU) mentioned in the documentation will <a rel=\"noreferrer noopener\" aria-label=\"cost  (opens in a new tab)\" href=\"https:\/\/aws.amazon.com\/ec2\/pricing\/on-demand\/\" target=\"_blank\">cost <\/a>about 1.7 US cents per hour (depending on region) (or <a rel=\"noreferrer noopener\" aria-label=\"it might be free (opens in a new tab)\" href=\"https:\/\/aws.amazon.com\/free\" target=\"_blank\">it might be free<\/a>) including the licensing cost of Microsoft Windows.  <\/p>\n\n\n\n<p>Running a Windows instance with 1 GiB RAM and 1 vCPU  (usually one thread on one core &#8211; <a rel=\"noreferrer noopener\" aria-label=\"see documentation (opens in a new tab)\" href=\"https:\/\/aws.amazon.com\/ec2\/instance-types\/\" target=\"_blank\">see documentation<\/a>) is going to be interesting. Most Windows users are familiar with Windows needing 8 GiB RAM to do something useful. After installing Studio 2.0, I attempted to run it, and it failed to start. Guessing that RAM was the issue, I stopped the EC2 instance and changed the instance type to t3.medium. This has 2 vCPU and 8GiB RAM.  Then I launched Studio 2.0, opened one of the demo models, and opened the resource monitor.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" width=\"1024\" height=\"599\" src=\"https:\/\/www.wis.co.uk\/blog\/wp-content\/uploads\/2019\/06\/t3-medium-8-GiB-2-vCPU-1024x599.png\" alt=\"\" class=\"wp-image-616\" srcset=\"https:\/\/www.wis.co.uk\/blog\/wp-content\/uploads\/2019\/06\/t3-medium-8-GiB-2-vCPU-1024x599.png 1024w, https:\/\/www.wis.co.uk\/blog\/wp-content\/uploads\/2019\/06\/t3-medium-8-GiB-2-vCPU-300x175.png 300w, https:\/\/www.wis.co.uk\/blog\/wp-content\/uploads\/2019\/06\/t3-medium-8-GiB-2-vCPU-768x449.png 768w, https:\/\/www.wis.co.uk\/blog\/wp-content\/uploads\/2019\/06\/t3-medium-8-GiB-2-vCPU.png 1437w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption>Bricklink Studio 2.0 running on Windows Server 2019 <br>on AWS  t3.medium with 8 GiB RAM and 4 vCPU<\/figcaption><\/figure>\n\n\n\n<p>When Studio 2.0 is doing nothing, it maxes out both vCPU. With this model, Windows uses less than 2 GiB RAM. Time to switch <a rel=\"noreferrer noopener\" aria-label=\"instance types (opens in a new tab)\" href=\"https:\/\/aws.amazon.com\/ec2\/instance-types\/\" target=\"_blank\">instance types<\/a> again:  <br>I tried c5.xlarge which has the smallest amount of RAM (8GiB) for 4 vCPU. A restart, a new RDP file, log in again, launch Studio 2.0 and open the resource monitor.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" width=\"1024\" height=\"594\" src=\"https:\/\/www.wis.co.uk\/blog\/wp-content\/uploads\/2019\/06\/c5.xlarge-8-GiB-4-vCPU-1024x594.png\" alt=\"\" class=\"wp-image-618\" srcset=\"https:\/\/www.wis.co.uk\/blog\/wp-content\/uploads\/2019\/06\/c5.xlarge-8-GiB-4-vCPU-1024x594.png 1024w, https:\/\/www.wis.co.uk\/blog\/wp-content\/uploads\/2019\/06\/c5.xlarge-8-GiB-4-vCPU-300x174.png 300w, https:\/\/www.wis.co.uk\/blog\/wp-content\/uploads\/2019\/06\/c5.xlarge-8-GiB-4-vCPU-768x446.png 768w, https:\/\/www.wis.co.uk\/blog\/wp-content\/uploads\/2019\/06\/c5.xlarge-8-GiB-4-vCPU.png 1441w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p> When Studio 2.0 is doing nothing, it maxes out all four vCPU.  Time to try more cores. I tried the c5.4xlarge. New accounts have a service limit of zero for this instance size. Increasing the service limit is straightforward, but can take an hour to propagate.  Instead I tried the c4.4xlarge (previous generation) instead. It has 16 vCPU  and 30 GiB RAM.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" width=\"1024\" height=\"598\" src=\"https:\/\/www.wis.co.uk\/blog\/wp-content\/uploads\/2019\/06\/c4.4xlarge-30-GiB-16-vCPU-1024x598.png\" alt=\"\" class=\"wp-image-628\" srcset=\"https:\/\/www.wis.co.uk\/blog\/wp-content\/uploads\/2019\/06\/c4.4xlarge-30-GiB-16-vCPU-1024x598.png 1024w, https:\/\/www.wis.co.uk\/blog\/wp-content\/uploads\/2019\/06\/c4.4xlarge-30-GiB-16-vCPU-300x175.png 300w, https:\/\/www.wis.co.uk\/blog\/wp-content\/uploads\/2019\/06\/c4.4xlarge-30-GiB-16-vCPU-768x449.png 768w, https:\/\/www.wis.co.uk\/blog\/wp-content\/uploads\/2019\/06\/c4.4xlarge-30-GiB-16-vCPU.png 1443w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Studio 2.0 was happy to consume 88% of all 16 vCPU , even when apparently doing nothing. <\/p>\n\n\n\n<p>Over the course of these tests, I also tried the render options, which was the original idea all along, rendering the simplest static image test (not an animation) for this demo model.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>The c5.xlarge   (4 vCPU) took 2min57sec to render the frame. <br>The c4.4xlarge (16 vCPU) took 0min55sec to render the frame.<\/strong><\/pre>\n\n\n\n<p>How much is all this costing me? Most of these instance types don&#8217;t qualify for Free Tier, so I&#8217;m incurring real cost. Windows instances are charged per hour or per part-hour.  These tests typically took 10 minutes per instance type. Looking at London prices with Windows:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">t2.micro    (1 vCPU and  1 GiB RAM) : $0.0178 per Hour <br>t3.medium   (2 vCPU and 8  GiB RAM) : $0.0656 per Hour<br>c5.xlarge   (4 vCPU and 8  GiB RAM) : $0.386  per Hour<br>c4.4xlarge (16 vCPU and 32 GiB RAM) : $1.686  per Hour <br>EBS volume: 30 GB * $0.116 \/GB-month : about $0.02 for 5 hours. <br>------------------------------------------------------<br>Total cost :                        : $2.18<br><br>Notes: <br> * c5.4xlarge is cheaper  : $1.544 per Hour <br>   <\/pre>\n\n\n\n<p>Further work involves automating the build of the machine using CloudFormation, and testing a render using a graphics-card instance.<\/p>\n\n\n\n<p style=\"text-align:right\">Justin &#8211; June 2019<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A friend of mine is using Studio 2.0 from Bricklink to create digital models in Lego. He is particularly interested in rendering (creating real-looking images of models that only exist in the computer). The models are complex, and include transparent &hellip; <a href=\"https:\/\/www.wis.co.uk\/blog\/launching-windows-programs-on-aws\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[9,8],"tags":[50,53,26,38],"_links":{"self":[{"href":"https:\/\/www.wis.co.uk\/blog\/wp-json\/wp\/v2\/posts\/600"}],"collection":[{"href":"https:\/\/www.wis.co.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wis.co.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wis.co.uk\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wis.co.uk\/blog\/wp-json\/wp\/v2\/comments?post=600"}],"version-history":[{"count":24,"href":"https:\/\/www.wis.co.uk\/blog\/wp-json\/wp\/v2\/posts\/600\/revisions"}],"predecessor-version":[{"id":634,"href":"https:\/\/www.wis.co.uk\/blog\/wp-json\/wp\/v2\/posts\/600\/revisions\/634"}],"wp:attachment":[{"href":"https:\/\/www.wis.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=600"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wis.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=600"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wis.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=600"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}