I have an Elastic Beanstalk worker app that is doing some memory-intensive single-threaded computation. All the available instance types that meet my memory requirements (16 Gb) have 2+ vCPUs, so I only hit 50% CPU usage. Edit: This is just a quirk of how CPU usage is reported when hyperthreading is enabled
I see that on the instance types I'm interested in, I should be able to disable hyper-threading by setting the ThreadsPerCore CPU option to 1, giving me a free performance boost, but Elastic Beanstalk doesn't seem to provide a way to set this in it's standard settings.
The docs have plenty of examples of how to add custom resources using cloud formation in .ebextensions. They also allude to the fact that the standard resources created by EB can be modified; but I couldn't find any examples of this in practice. Having not used cloud formation before, I'm struggling to put the pieces together!
Update: Looking at this answer, it looked like I could just "redeclare" the EB resources and override the config, so I tried the following in an .ebextensions .config file:
Resources:
AWSEBEC2LaunchTemplate:
Type: AWS::EC2::LaunchTemplate
Properties:
LaunchTemplateData:
CpuOptions:
ThreadsPerCore: 1
This feels like it gets me closer, but now when I deploy to Elastic Beanstalk, I get the following error: InvalidParameterValue: Both EC2 Launch Template and AS Launch Configuration exist in the template.
No results on Google for that one.
This seems like it might be a reference to the fact that an autoscaling group uses either a launch template, or a lauch configuration, but not both; but I haven't touched the scaling group, and when I look at the resources that EB creates as standard, there is no launch configuration, only a launch template.