Home > database >  devops aws django website scalability : how is auto scaling done in elastic beanstalk and elastic co
devops aws django website scalability : how is auto scaling done in elastic beanstalk and elastic co

Time:04-19

Im developing a django website. On the devops side, im considering using aws with an autoscaling. I still hesitate to contenerize my config, so I would use either beanstalk (without container) or container service (with docker). The database will be on aurora on a separate server. I am new to aws and the help they provide online by expert is not free so here is my question :

when i compare with other hosting providers, their prices depend on the hardware configuration of the server. I guess (because i dont yet have access to cost explorer) that it is the same with ec2 instances on amazon: you pay more for more powerful servers (cpu and ram and/or storage). so im wondering how elastic beanstalk or elastic container instanciate new ec2 servers : Do they invoke more powerful hardware configurations(scaling up) based on the demand on my website or does it depend on my manual configuration ? Or do they only replicate ec2 instances (scaling out) with the same config i manually set at the init? Can i manually change the cpu,ram and storage of an ec2 instance of benstalk or ecs without re-configuring it all? Can i fine tune the autoscaling out and autoscaling up and which scaling is better and cheaper (best choice)? thanks a lot!

CodePudding user response:

Auto Scaling groups scales out horizontally, means spawn new instances like defined in the launch template/launch configuration. Auto Scaling group cannot scale vertically. You can change the launch cofiguration and edit the instance type and size, which will replace your instances in the Auto Scaling Group. https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-asg-launch-template.html

With ECS, you have to option Fargate or ECS on EC2. With Fargate (serverless) you can easily define how much resource RAM/CPU you want to allocate to the "task" to run. With ECS EC2, you need to first create the ECS Cluster (need to allocate EC2 for running the cluster), then create a seperate task and then allocate RAM and CPU to it. https://docs.aws.amazon.com/AmazonECS/latest/userguide/task_definition_parameters.html

Using Beanstalk you can easily define how much resources RAM/CPU want to use in the configuration. (Easier than just running plain autoscaling groups with a load balancer). It has a very easy interface to play around and adjust the resources.

  • Related