Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

joydasolive's avatar

Scaling AWS EC2 instance on Forge

I have a AWS EC2 (m4.xlarge) instance setup on Forge. I host my Laravel API and the Angular frontend on the same instance, so the database is on the same instance too. It uses the EBS volume(20GB) that comes with it. It's been working fine so far but recently got a bit slower when it comes to complex queries. So, I am thinking of moving it to a larger instance(m4.2xlarge).

So far: I am not using any load balancer. Not separating database/web server. One instance to power everything.

I know this was not the best practice but we just had to deploy the application quickly. This is a closed app and only around few hundreds devices use it but constantly throughout the day. Most request goes through API. It has some complex queries and I think that's taking some time once the requests come together.

If I want to move it to a larger instance, I can stop the instance, change the instance type, start the instance. Now my question is, is there any downsides as I am using the same ssh and DB user/password forge provisioned and also using quick deploying the code from repo. What's the best way to change the instance type and still keep the application running as it is (with scheduled jobs, queues etc) apart from some downtime?

0 likes
1 reply
royduin's avatar
royduin
Best Answer
Level 8

Just shutdown the instance when the traffic is low and scale it up, everything should work as before when the instance is done booting.

1 like

Please or to participate in this conversation.