- Newest
- Most votes
- Most comments
Hello,
It's really hard to say why this may happen, but I think the most common would be due to a "noisy neighbor". Since these instances are on shared resources, you're likely to run into sporadic slowness on the lower instance types. Laravel itself does not use a lot of memory & CPU (depending on how many additional 3rd party packages you're using), but any sort of external connections to databases and what not will only add to the additional latency of loading pages.
For running Laravel on Lightsail, I would also recommend switching to Nginx/PHP-FPM over Apache as you will see some additional performance with the split processes instead of the requests being cobbled together on combined Apache processes.
I also recommend using no less than 1GB of Memory because with anything lower you are likely to have a lot of memory issues. You could also enable additional storage and add swap as memory, but it will only be a marginal help.
Here's a helpful guide for adding swap to a linux instance: https://aws.amazon.com/premiumsupport/knowledge-center/ec2-memory-swap-file/. (It says for EC2, but it's relevant for Lightsail as well)
Relevant content
- asked a year ago
- Accepted Answerasked 5 years ago
- AWS OFFICIALUpdated 4 months ago
- AWS OFFICIALUpdated 3 months ago
- AWS OFFICIALUpdated 2 years ago