Lightsail Instance Fails Status checks after random CPU max out

0

I am having an issue with my Lightsail instance becoming inaccessible. Around 0300 UTC the CPU will spike to 100% usage(for less than 5 minutes), then I begin to get Instance Status Check Failures.

I cannot log in to the Wordpress admin dashboard, nor can I access SSH via Putty nor the web console.

I have to manually go in to Lightsail and stop the Instance and then start it. I am intending this to become a production server for the website of an event I run. Very simple Wordpress site which should run with no issues on a 1GB, 1vCPU instance. It is currently just in development so there is literally zero traffic to the site so there is no way it should be using any resources really...

Looking through the syslog I can see the following around the time the of the CPU spike

Mar 20 02:09:01 ip-172-26-4-68 CRON[18990]: (root) CMD (  [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)
Mar 20 02:09:02 ip-172-26-4-68 systemd[1]: Starting Clean php session files...
Mar 20 02:09:05 ip-172-26-4-68 systemd[1]: phpsessionclean.service: Succeeded.
Mar 20 02:09:05 ip-172-26-4-68 systemd[1]: Finished Clean php session files.
Mar 20 02:09:08 ip-172-26-4-68 systemd-networkd[445]: eth0: DHCPv6 address 2600:1f16:237:5d00:7ba1:b960:d9e5:f2e9/128 timeout preferred 140 valid 450

So it seems some kind of CRON job is taking down the system and not recovering. Can anyone help me figure out how to stop this?

Thanks

asked 2 years ago1044 views
1 Answer
0

The root of the problem is that a scheduled process on the instance is exhausting the cpu burst capacity of the instance.

Understanding how cpu capacity works in Lightsail should help resolve the issue: https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-viewing-instance-burst-capacity#baseline-cpu-performance

There is a tool named "cpulimit" that can be used to limit the CPU utilization of running processes or launch new processes with such limits. It is not installed by default on Lightsail's WordPress blueprints but can be installed by issuing the command sudo apt install cpulimit. The idea is that you would modify the cron jobs so that they cannot take 100% of the CPU and consume your instances CPU credits.

I hope this helps!

profile pictureAWS
answered 2 years 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.

Guidelines for Answering Questions