How can I reboot lightsail instance using cloudwatch or something?

0

My lightsail instance used to stop working. So I want to reboot lightsail instance if CPU usage is over danger percent. I tried to create alarm in CloudWatch but I couldn't see Lightsail when choose metric. I checked region but it was correct. What is the issue? Or what should I do to implement this? Thank you in advance.

2개 답변
0

Hello.

Lightsail does not output metrics to CloudWatch, so you cannot directly create alarms and run Lambda.
https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-resource-health-metrics.html

So, why not introduce CloudWatch Agent to Lightsail, create custom metrics, and run Lambda?
https://repost.aws/knowledge-center/lightsail-monitor-with-cloudwatch

profile picture
전문가
답변함 2달 전
0

Lightsail instances can slow down and appear as unresponsive when the instance consistently consumes more CPU than the Lightsail plan provides as a baseline. Lightsail uses burstable instance types that allow you to consume more CPU than your baseline for short periods of time. However, if an application continues to use more CPU beyond the plan's resources for long periods of time, the performance of the instance may suffer. This can happen for large or CPU intensive applications that run on a small plan size. We are working on ways to make it easier to diagnose when this issue is happening.

Here are two options on addressing the issue:

Scale up your instance If you find your instances are encountering this scenario, you can scale up your instance to the next plan size for improved performance. You can increase your plan size by taking a snapshot of your instance and then recreating a new, larger instance from your snapshot: https://lightsail.aws.amazon.com/ls/docs/en/articles/how-to-create-larger-instance-from-snapshot-using-console

Disable unnecessary resource consuming code You can try to pinpoint resource-intensive processes that are not essential to your application, but are consuming your CPU, and disable them. For example, in applications like WordPress, custom themes, WordPress plugins, or other processes may be unnecessarily consuming your CPU in the background. If these element are not essential, you can turn them off.

AWS
중재자
답변함 2달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인