Reduce server response time

January 8, 2016 3.9k views
WordPress VPN Ubuntu

How do I reduce my server response time, its about 1.2 seconds on average. Im using digital ocean with server pilot.

6 Answers

Hi,

Slow responses for an individual request mean your PHP scripts are slow. You can check how long each script takes to execute by looking at your app's PHP access log located at:

/srv/users/serverpilot/log/APPNAME/APPNAME_phpX.Y.access.log

For example, the lines will look like this:

12.34.56.78 - [09/Jan/2016:20:10:58 +0300] "GET /index.php" 200 0 - 15073 32042 0.017 4194304 0.00% 0.00% "/"

In that example, the value 0.017 is the number of seconds PHP spent processing the request. On your server, you'll like see larger times.

If you're using WordPress, the most common cause of slowness is slow plugins. If you're on WordPress, try disabling all plugins, customizations, and using the default theme to see how fast your app is without any 3rd party code.

Also, if the 1.2 seconds isn't the time for the response of a single script but rather how long your browser takes to load all resources from the page, then it may have nothing to do with slow PHP scripts and instead the problem is your site is loading large numbers of large resources (stylesheets, images, etc.) and it's taking the browser a while to load all of these. This can generally be solved by cleaning up the site's HTML and getting rid of unnecessary things included in the page.

I hope that helps.

I was going to post this question. Glad that it is already answered.

Hey i have tried above solution on my blog talkmetech.com but it's not working, i am checking this with google page speed

Using wordpress with digital ocean its simply down to the amount of plugins you use. The less bloated your theme the fater the server response time. We have re-written all our themes to require no plugins.

The response time is now 0.03s

I have been getting "Reduce server response time" issues with the Pagespeed Insights tool.

To test whether it is due to some slow PHP script or Wordpress or hosting issue, I duplicated my website at Digitalocean and pasted it in Google Cloud - Google Compute Engine instance.

Problem solved! In Google Cloud I'm able to get faster server response times and pass the Pagespeed test with flying colors even with the smallest VPS in gcloud.

So it's not due to PHP or Wordpress. Digitalocean server has server response time issues. The difference was between 300ms and 1s.

Have another answer? Share your knowledge.