I need suggestions on how to diagnose this issue. I'm running two Magento 2 stores on two separate Amazon EC2 Ubuntu 16.04.7 Micro instances. Both were running Magento 2.3.5 successfully for a long time, and I have now updated to 2.4.2 and PHP 7.4. Since the update, they crash the hole EC2 instances 2-3 times per day. Both of them have the same issue. Sometimes I can see the CPU spike go up to 100% before the crash. I'm analysing traffic using GoAccess to see if there are any suspicious bots. There is not a huge amount of traffic. 3500 hits per day, 95 unique visitors, 18 MB of data. From crawlers/bots I get 1200 hits per day for 343 unique bots and 20 MB of data is transfered.
I'm using 2 GB of swap (1.5 GB free normally) and 1 GB of RAM (500 MB free during normal use).
They have around 3 GB of disk space which isn't filled up during the crash.
Here are my PHP settings /etc/php/7.4/cli/php.ini
post_max_size = 128M memory_limit = 2048M max_execution_time = 18000 max_input_time = 6000 zlib.output_compression = On session.gc_maxlifetime = 1440000 display_errors = Off
max_execution_time = 18000 max_input_time = 6000 memory_limit = 1024M date.timezone = Europe/Stockholm session.gc_maxlifetime = 1440000 display_errors = Off
The last entry in the Magento system.log is
13:04: main.INFO: Consumer "async.operations.all" skipped as required connection "amqp" is not configured. Unknown connection name amqp  
14.05: EC2 monitoring lose contact with the server 14.11 Nginx stops logging, but mostly HTTP 499. The last log message is someone trying to exploit magmi.ini (Magento 1 bug?)
GET /en/sales/guest/form/magmi/conf/magmi.ini HTTP/1.1" 301
So, what is the most likely issue here? I'm going to try and set up a Cloud Watch for the RAM as well.