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

October 9, 2018 1k views
Nginx PHP LEMP Ubuntu 18.04

Hey,
I have droplet together with runcloud.io (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

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.

Have another answer? Share your knowledge.