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 bricks, and his poor home computer isn’t up to the job. How difficult is it to run a Windows machine in AWS, to do the rendering “in the cloud”?
It’s easy to create Windows instances via the web-based AWS console. This page in the documentation explains how. The “t2.micro” instance size (1 GiB RAM and 1 vCPU) mentioned in the documentation will cost about 1.7 US cents per hour (depending on region) (or it might be free) including the licensing cost of Microsoft Windows.
Running a Windows instance with 1 GiB RAM and 1 vCPU (usually one thread on one core – see documentation) 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.
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 instance types again:
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.
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.
Studio 2.0 was happy to consume 88% of all 16 vCPU , even when apparently doing nothing.
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.
The c5.xlarge (4 vCPU) took 2min57sec to render the frame.
The c4.4xlarge (16 vCPU) took 0min55sec to render the frame.
How much is all this costing me? Most of these instance types don’t qualify for Free Tier, so I’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:
t2.micro (1 vCPU and 1 GiB RAM) : $0.0178 per Hour
t3.medium (2 vCPU and 8 GiB RAM) : $0.0656 per Hour
c5.xlarge (4 vCPU and 8 GiB RAM) : $0.386 per Hour
c4.4xlarge (16 vCPU and 32 GiB RAM) : $1.686 per Hour
EBS volume: 30 GB * $0.116 /GB-month : about $0.02 for 5 hours.
Total cost : : $2.18
* c5.4xlarge is cheaper : $1.544 per Hour
Further work involves automating the build of the machine using CloudFormation, and testing a render using a graphics-card instance.
Justin – June 2019