Droplet gets slow with time (response time 700ms to 3000ms), any tips please?

Posted October 9, 2018 3.9k views
NginxPHPLEMPUbuntu 18.04

I have droplet together with (nginx)
512mb ram, 1 cpu
I tried to increase the amount of ram and cpu but the problem did not work out.

I have a simple PHP page that takes information from a site and returns information to visitors,
I have about 5000 requests per hour for this page.

The problem is, I want the response time for the php page will be one second, and with the time (after 10-24 hours) the response time is getting longer

Once I do rebuild to the droplet response time of the page is 700ms everytime
After 10-24 hours (3000-6000ms)

I have to occasionally do a rebuild and this is what solves the problem

Are there any commands that can help without the need to rebuild the droplet?

*By the way, does not appear any load and everything remains about 20-40% always

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
3 answers

You’ll need to optimize your server instead of rebuilding it. Start by optimizing Nginx and then PHP FPM (look at setting the right value for max_children for example). There are many things that need to be looked at but I’d need to take a closer look at the server.

In google chrome press f12 hit network tab and disable cache. Open your page now and see which component is loading the slowest.

Consider using this thingy as it’ll increase the overall performance compared to a regular set'up.