This September, I was learning PHP and as a side project, I made a small PHP website. This PHP website is kind of VIRAL nowadays and I am having a tough time managing it.
I even got a job opportunity because of it -
Here’s the link - Quizprank
Previously I used a free hosting service googihost, but it could not handle much traffic 300+ Realtime users would result in 503 error.
So I switched it to Digitalocean because I got 50$ free credit.
Current server configuration -
Shared CPU 4 vCPUs 8 GB RAM 50 GB Storage 5 TB Data Transfer
I am running Apache2 server and MySQL server on it.
The RAM utilisation is like 10%
The CPU utilisation is like 95%+
Currently, my website can never go past 250 page views per minute, Any more request will probably Overload my server. The main problem is every request require at least one SELECT query to run in MySQL and MySQL can’t handle much stress.
Can anyone help if I show you exact config file for MySQL and Apache2?
I tried using a config from StackOverflow into MySQL but it reduced the performance further.
I am currently using Cloudflare to cache most of the static content to reduce the load on my server. And Cloudflare firewall is also helping me to block all the known bots like - Googlebot, Applebot, Twitterbot etc. because they also overwhelm my server during the peak hours.
But these things don’t help.