Skip to content

Beanstalk Windows CloudWatch agent start generating extra CPU over time

0

Hello everybody, does anybody faced the problem with SurPlus generated by CloudWatch agent? It's hard to argue with AWS regarding this as response time is high. So usually it resolved by instance replace.

The configuration is: Beanstalk on Windows, IIS application. Upon time, CloudWatch agent start generating extra CPU which leads to SurPlus charges :( Is there a workaround for that?

Thanks in advance

1 Answer
0

Based on the information provided, it sounds like you're experiencing increased CPU usage from the CloudWatch agent on your Windows Beanstalk environment over time, leading to surplus charges.

Here are some potential solutions to address this issue:

  1. Check and update your CloudWatch agent configuration. The agent might be collecting more metrics than needed or at too high a frequency. You can modify the metrics_collection_interval in your configuration file to increase the collection interval (higher values mean less frequent collection).

  2. Enable debug logging to identify what might be causing the increased CPU usage. In the agent configuration file, in the agent section, set the debug field to true, then reconfigure and restart the CloudWatch agent. This will provide more detailed information in the agent logs located at $Env:ProgramData\Amazon\AmazonCloudWatchAgent\Logs\amazon-cloudwatch-agent.log.

  3. Check if you're collecting process metrics (procstat) which can be CPU-intensive. The metrics like procstat_cpu_usage, procstat_memory_rss, etc., suggest process monitoring is enabled, which can consume more resources.

  4. After making configuration changes, restart the agent using the fetch-config option to ensure the new configuration is applied:

$Env:ProgramData\Amazon\AmazonCloudWatchAgent\bin\amazon-cloudwatch-agent-ctl -a fetch-config -m ec2 -s -c file:configuration-file-path
  1. If the issue persists, you might consider temporarily stopping the agent to confirm it's the source of the problem:
$Env:ProgramData\Amazon\AmazonCloudWatchAgent\bin\amazon-cloudwatch-agent-ctl -m ec2 -a stop

Remember that any time you change the agent configuration file, you must restart the agent for the changes to take effect.
Sources
Troubleshooting the CloudWatch agent - Amazon CloudWatch
Common scenarios with the CloudWatch agent - Amazon CloudWatch
We need to know why these additional stats appear for our VMs. | AWS re:Post
How to update clodwatch agent config on a Ec2 | AWS re:Post

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.