Reputation: 905
I have a java application which is deployed on aws ec2 cluster. I have auto scaling configured based on cpu usage but the problem is application is not CPU intensive but is IO intensive, CPU usage is 20% on an average, so when traffic increases it is not able to send all the messages in real time causing buffering. This is causing delay in arrival of messages in downstream systems.
How can i auto scale my cluster based on incoming traffic and heap usage of deployed application?
Upvotes: 1
Views: 1550
Reputation: 4491
You can create a bash script, running with cron, that collect the Java heap memory usage and incoming connections, and then sends the to cloudwatch custom metrics.
How to collect to memory and disk stats from AWS ec2 instances
And then Alert and Auto scale based on those custom metrics
Upvotes: 0
Reputation: 473
you should use custom metrics for this purposes CloudWatch does not collect memory consumption by default. To enable this you should use custom metrics script and then you be able to change autoscaling group behavior corresponding to memory consumption chages or any other event which you need to monitor and react
Upvotes: 2