App streaming cost optimization

App streaming cost optimisation

App-streaming stack can have always-on / on- demand fleets .

Choose the fleet type based on your business requirements .

For Non prod and services which do not require 24/7 availability, you can go with o…


This content originally appeared on DEV Community and was authored by selvakumar palanisamy

App streaming cost optimisation

App-streaming stack can have always-on / on- demand fleets .

Choose the fleet type based on your business requirements .

For Non prod and services which do not require 24/7 availability, you can go with on -demand fleets and also include autoscaling in your fleets to optimise the cost .Below the details about app streaming fleet types

  1. Always-On fleets, users get instant-on access to their applications, but you are charged streaming fees for all instances in the fleet, even if no users are connected.
  2. On-Demand fleets, users experience a small delay accessing their first application. However, users are only charged streaming fees for instances when they  are connected, and a small, fixed hourly fee for instances in their  fleet that are not being used.    "No streaming resources are available for your session," means that at the time user  tried to sign in, all available AppStream sessions were currently in use by other users. Apps on Demand will be aware of user  attempt to sign in, and will begin preparing another session, a process that may take up to ten minutes. suggestion is to wait about ten minutes, then click retry.

Savings of on-demand over always-on is ~30% +

image

Auto scaling config

Below the sample auto scaling config to optimize the app stream fleet usage and the run cost

image

 
 

$>aws application-autoscaling register-scalable-target --service-namespace appstream --resource-id fleet/fleet-name --scalable-dimension appstream:fleet:DesiredCapacity  

aws application-autoscaling put-scheduled-action --service-namespace appstream --resource-id fleet/fleet-name --scheduled-action-name weekdaystart --schedule="cron(0 0 21 ? * SUN-THU *)" --scalable-target-action MinCapacity=3,MaxCapacity=15 --scalable-dimension appstream:fleet:DesiredCapacity 

aws application-autoscaling put-scheduled-action --service-namespace appstream --resource-id fleet/fleet-name --scheduled-action-name weekdayend --schedule="cron(0 0 7 ? * MON-FRI *)" --scalable-target-action MinCapacity=1,MaxCapacity=1 --scalable-dimension appstream:fleet:DesiredCapacity 

aws application-autoscaling put-scheduled-action --service-namespace appstream --resource-id fleet/fleet-name --scheduled-action-name weekend --schedule="cron(0 0 13 ? * FRI-SAT *)" --scalable-target-action MinCapacity=1,MaxCapacity=1 --scalable-dimension appstream:fleet:DesiredCapacity 

Note : cron triggers in AWS are set up on UTC time, you need to adjust the time as per your time zone

To know the scheduled actions associated with a fleet

$>aws application-autoscaling describe-scheduled-actions --service-namespace appstream --resource-id fleet/fleet-name

 

{
    "ScheduledActions": [
        {
            "ScheduledActionName": "weekdaystart",
            "ScheduledActionARN": "arn:aws:autoscaling:ap-southeast-2:account-id:scheduledAction:xxxxxxxx-ba8d-xxx-85be-xxxxxxxxx:resource/appstream/fleet/fleet-name:scheduledActionName/weekdaystart",
            "ServiceNamespace": "appstream",
            "Schedule": "cron(0 0 21 ? * SUN-THU *)",
            "ResourceId": "fleet/fleet-name",
            "ScalableDimension": "appstream:fleet:DesiredCapacity",
            "ScalableTargetAction": {
                "MinCapacity": 3,
                "MaxCapacity": 15
            },
            "CreationTime": "2021-07-16T09:59:50.125000+00:00"
        },
        {
            "ScheduledActionName": "weekdayend",
            "ScheduledActionARN": "arn:aws:autoscaling:ap-southeast-2:account-id:scheduledAction:xxxxxxxx-ba8d-xxx-85be-xxxxxxxxx:resource/appstream/fleet/fleet-name:scheduledActionName/weekdayend",
            "ServiceNamespace": "appstream",
            "Schedule": "cron(0 0 7 ? * MON-FRI *)",
            "ResourceId": "fleet/fleet-name",
            "ScalableDimension": "appstream:fleet:DesiredCapacity",
            "ScalableTargetAction": {
                "MinCapacity": 1,
                "MaxCapacity": 1
            },
            "CreationTime": "2021-07-16T10:00:05.234000+00:00"
        },
        {
            "ScheduledActionName": "weekend",
            "ScheduledActionARN": "arn:aws:autoscaling:ap-southeast-2:account-id:scheduledAction:xxxxxxxx-ba8d-xxx-85be-xxxxxxxxx:resource/appstream/fleet/fleet-name:scheduledActionName/weekend",
            "ServiceNamespace": "appstream",
            "Schedule": "cron(0 0 13 ? * FRI-SAT *)",
            "ResourceId": "fleet/fleet-name",
            "ScalableDimension": "appstream:fleet:DesiredCapacity",
            "ScalableTargetAction": {
                "MinCapacity": 1,
                "MaxCapacity": 1
            },
            "CreationTime": "2021-07-16T10:00:17.031000+00:00"
        }
    ]
}


This content originally appeared on DEV Community and was authored by selvakumar palanisamy


Print Share Comment Cite Upload Translate Updates
APA

selvakumar palanisamy | Sciencx (2021-08-06T05:53:51+00:00) App streaming cost optimization. Retrieved from https://www.scien.cx/2021/08/06/app-streaming-cost-optimization/

MLA
" » App streaming cost optimization." selvakumar palanisamy | Sciencx - Friday August 6, 2021, https://www.scien.cx/2021/08/06/app-streaming-cost-optimization/
HARVARD
selvakumar palanisamy | Sciencx Friday August 6, 2021 » App streaming cost optimization., viewed ,<https://www.scien.cx/2021/08/06/app-streaming-cost-optimization/>
VANCOUVER
selvakumar palanisamy | Sciencx - » App streaming cost optimization. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/08/06/app-streaming-cost-optimization/
CHICAGO
" » App streaming cost optimization." selvakumar palanisamy | Sciencx - Accessed . https://www.scien.cx/2021/08/06/app-streaming-cost-optimization/
IEEE
" » App streaming cost optimization." selvakumar palanisamy | Sciencx [Online]. Available: https://www.scien.cx/2021/08/06/app-streaming-cost-optimization/. [Accessed: ]
rf:citation
» App streaming cost optimization | selvakumar palanisamy | Sciencx | https://www.scien.cx/2021/08/06/app-streaming-cost-optimization/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.