Pixel streaming considerations in AWS
Additionally, running in the cloud reduces operating costs as resources can be shut down when they are not needed… There are limitations to how quickly resources can scale, where resources are available, and the possibility of hardware failure… This prevents bad actors from spinning up accoun…
The cloud can greatly benefit members of the game industry. It provides a robust and secure development and hosting environment with the latest in computing technology. AWS offers Intel, AMD, ARM, and Nvidia processors combined with an on-demand cost structure. This means developers have computing power when they need it with minimal upfront investment. This can reduce development time by eliminating the need to manage physical hardware and. Additionally, running in the cloud reduces operating costs as resources can be shut down when they are not needed.
While the benefits of the cloud are plenty, there are some things to keep in mind before going all in with AWS. The cloud operates on physical hardware that AWS manages in various data centers around the globe. There are limitations to how quickly resources can scale, where resources are available, and the possibility of hardware failure. For these reasons it is recommended to design a robust architecture that takes these constraints into account to ensure application success and uptime.
Streaming is a growing business, and more companies are looking to stream game content to minimize the end user cost of consoles. When it comes to streaming game data to end users, there are important factors to consider when architecting your streaming design for AWS.
Resource Quotas
By default, new AWS accounts have low quotas, formerly known as limits. This prevents bad actors from spinning up accounts and resources for nefarious purposes. It protects both the new account from fraudulent usage as well as protecting the overall AWS infrastructure. After a period of trusted usage, these limits will grow on their own. However, you can also request to have these limits raised manually if a workload requires. Keep this in mind for all services. When planning a new application or development environment, look at your existing limits to make sure you have room to grow and not inadvertently be unable to launch a resource. See the Service endpoints and quotas documentation to view the current limits.
Scaling & Orchestration
AWS offers the ability to scale application resources in real time, allowing for a seamless increase in resources to match end user activity. When done properly, this results in an easy to manage and efficient experience, but there are limitations to how quickly AWS can scale.
Similar to resource quotas, there are API limits in place to protect the entirety of the AWS fleet. This means that if you try to scale from 10 Amazon Elastic Compute Cloud (Amazon EC2) instances to 1000 in one minute, you may get throttled as the Amazon EC2 backend may not be able to handle that much scaling so quickly.
Consider how and when you need to scale to make the growth less aggressive if you see you’re being rate limited. This could include implementing exponential back off of API calls, initiating a scaling event earlier with a smaller amount, or having a warm pool of resources standing by. It is important to understand what your end user usage patters are like before implementing intelligent scaling for Amazon EC2.
Other services scale automatically as well, like Elastic Load Balancing (ELB) which scales slowly with increased traffic, so they need to be considered as well. The application load balancer in particular can be pre-warmed with the help of AWS to ensure that the load balancer is able to handle a steep influx of traffic, such as for a new game launch. You can reach out to AWS Support for assistance in ensuring your load balancer can handle any expected traffic.
Specialized Instances
Games customers can leverage specialized instances that offer the latest Intel and ARM CPUs, along with graphics cards powered by NVIDIA and AMD. These are powerful instances for use in high performance computing and game rendering, but are therefore in high demand. Keep this in mind as there may be situations where AWS cannot fulfill an instance request because there is no physical hardware available. This is true for all EC2 instances, but particularly for the lower volume, high demand types. AWS is continually adding new hardware to its fleet, but for in demand instances, it may be worth limiting the amount they scale. This will ensure you have the resource available when necessary. If future capacity is known, it is worth engaging with AWS support to work to pre-allocate resources for an upcoming build.
Insufficient Capacity Errors
In the event that AWS does not have physical capacity, you may see an ‘insufficient capacity error’ when attempting to launch an EC2 instance. To get around this, there are a few options available. The error itself is directly tied to the instance size, type, and Availability Zone (AZ) that the request falls under. This means that if a c6g.large is being requested in us-east-1a and is reporting insufficient capacity, there are other places to look. One option would be to try for a larger c6g.xlarge in the same AZ, or the same c6g.large but in us-east-1b. There is no guarantee that this will work, and it is not always desirable to choose a different instance size due to cost and performance constraints. However, this strategy allows your application to continue operating while you wait for optimal capacity.
It is worth noting that capacity is constantly in flux as customers launch and terminate instances. An insufficient capacity error could go away in minutes, or last days or weeks. It is impossible to tell, which is why it is recommended to try other instances types or Availability Zones’s as a workaround. Moving to a new AZ has its own implications, such as inter-AZ traffic charges. Be sure to factor that into any distributed system designs. Leveraging a single Availability Zone has the downside of being a single point of failure. Therefore, having resources spread across AZs lends itself to being more robust against hardware failure.
AWS Support
One of the best ways to avoid any of the aforementioned issues is to be forward looking with AWS usage. Understanding your applications future state and alerting AWS to upcoming growth opportunities can prevent unwanted downtime. AWS Support is available to help provide guidance and is a great resource to help adjust limits and address capacity concerns. They can help if you are seeing insufficient capacity errors or API throttling and can engage AWS service teams as necessary. They are available 24/7 and can be reached via e-ail, phone, or chat.
Conclusion
There are a lot of considerations when streaming gameplay to users from the cloud. Keep them in mind and try to work within AWS best practices to ensure smooth operation of your application. Planning ahead is the best way to avoid issues during app development and deployment. AWS offers managed solutions to let developers be more hands off with infrastructure, like AWS GameLift and AWS AppStream. These are intended to offload the management of resources and let AWS ensure your application is secure and highly performant. You can read about those offerings here:
https://aws.amazon.com/gamelift/
https://aws.amazon.com/appstream2/
Author: Alex Hevle