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 Risposte
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
ESPERTO
con risposta 2 mesi fa
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
MODERATORE
con risposta 2 mesi fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande