I was lucky enough that my website went viral, and the server of course wasn't ready for it.
Unfortunately my setup is quite bad, a single server with Apache, PHP (Laravel), Mongodb and redis.
The backend (laravel) mostly serve a REST API. I currently have 1000+ concurrent users trying to use the website, and everything loads really slowly. MongoDB seems to be working fine, since I can access it through terminal and queries are resolved immediately. What worries me is the Apache/PHP FPM configuration.
My server: 8 core, 16GB RAM
I tried to play with PHP FPM configurations but didn't improve by much. For now I have it on static
with 300 max_children
.
On Apache I'm using MPM event with this config:
<IfModule mpm_event_module>
ServerLimit 40
StartServers 2
MinSpareThreads 50
MaxSpareThreads 100
ThreadLimit 64
ThreadsPerChild 50
MaxRequestWorkers 1000
MaxConnectionsPerChild 0
</IfModule>
Using top
I have this, which seems fine to me:
Anyone can point me in the right direction?