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

oraparicio's avatar

Balancing server load on Forge

Hello everyone, i have a forge server on digital ocean 2.0, and now for just a couple of weeks my website will have huge traffic... i currently have a 1GB, 1 core server but it started to go down because huge concurrent traffic... i don't really want to upgrade the server so i enabled a new temporary server as a load balancer, but im not a linux genius and i don't understand how load balancing works, does it just works right out of the box??? i can't find any forge option to balance the load of any other server!!!... or do i have to make some configuration??? how the load balancing server know which server to balance???... because my site keeps going down and i have to reboot the server... any help will be appreciated

0 likes
1 reply
ohffs's avatar

For a load balancer to do anything very useful you need to have multiple servers 'behind' it. So you have something like :

LoadBalancer->
    Web Server 1
    Web Server 2
    Web Server 3
    etc

And you would need to share the database between your web servers etc. If you're not very familiar with this kind of thing you might want to look into putting your DB on another server (which will free up resources on your webserver) and setting up CloudFlare or similar to take some of the load off.

Edit: there's a nice article by @fideloper here about using a load balancer : https://serversforhackers.com/so-you-got-yourself-a-loadbalancer if you do want to go down that route.

Please or to participate in this conversation.