BLOG

How to fix the slow Server Response Time?

05 Dec 2017
Chandru
No Comments

Google recommends you to have a Server Response Time lesser than 200 ms.

Server Response Time is simply the time taken by the web server to respond to every single request made from the web browser.

Know what happens whenever a page is loaded?

When a user wants to open a particular web page, a request is sent from the web browser to the server to show its entire content and this process takes some time to execute.

This time taken to display a requested web page needs cumulative loading of both front-end and server-side components.

Nothing can happen till the requested HTML is received and loaded. Agree?.

Server response time plays a vital role in page loading time, which governs the deciding authority of whether or not to display your website instantly.

In my other blog, I have discussed why do you need to improvise your website’s performance?. Please refer to that.

Just think that you have optimized your web page and didn’t have a quicker response from the server, then you are still falling behind your competitor.

In general, whenever you find your website loading slow, you will immediately analyze it using the below tools and enhance your webpage load time. Some of the powerful tools to do that are:

GTMetrix  –  gtmetrix.com

PageSpeed  –  developers.google.com/speed/pagespeed/insights

SpeedBoost  –  speedboost.xyz

If by just optimizing the front end, results in quick load time, then imagine the effects on your website when you optimize the server-side too.

Yes, basically, your website will be lightning fast, thereafter.

Look into what Google says:

https://developers.google.com/speed/docs/insights/Server

There are many factors that slow down the response of your server and you can resolve it using the below-mentioned mantras:

  • Collection and examine the data.
  • Find and fix
  • Constant monitoring and awareness of further mishap.

The factors are:

  1. Quality of Database
  2. Web Hosting and Traffic
  3. Web Server Software
  4. Why reduce Resource Usage?

Before jumping into the factors, let’s look into this question,

How to reduce Server Response Time?

There are two ways to reduce the response of the server to a request.

  • Optimum utilization of existing resources.
  • Enhancement of the resources.

Both ways mentioned above can be related to all the factors that affect the server response time.

 

Database:

Considering SRT, the database is the prime factor normally.

Don’t allow any rooms for slow queries, as they are the topmost focus, because every time you make a request, the slow database queries make the server respond very slowly.

If your website depends on recovering data from a database, then you need to optimize your database to perform well.

You need a well-organized database to speed up your performance of queries and analyze your database response time.

To boost the performance of your queries, the following has to be done:

  • By rewriting the Queries
  • Use of relevant indices
  • Altering the Schema
  • External cache usage

 

Web Hosting and Web Traffic

Higher the Traffic, higher is the usage of server resources. It ultimately delays the response time of the server ending up in serving very few users in a specific period of time.

Also, even a quick loading website will become slow and torpid. So, the question is, how many resources are needed for a single user?. Well, it depends.

For instance, If your server can handle 200 requests every second, you can serve 50 resources for 4 users, 25 resources to 8 users and so on…

The below given pictorial illustration is just an example for you to grab it much better.

So, the thumb rule is, when you find increasing traffic, hosting enhancement needs to be done. Well, how to improve the performance of your hosting?. I’m suggesting you the inexpensive options to get maximum performance and to get rid of the traffic.

  • Free Hosting – Your website won’t have a lot of traffic in this hosting and it is non-risky. But you will experience slow speed connection, huge downtime, ads on the web pages.
  • A Shared Hosting – You can share your website’s resources with a lesser cost website. Again, you need to focus on various parameters like connection speed, server software, service, etc.
  • VPS Hosting – Virtual Private Server hosting – Many users share a single server. Allocation of server space is done for every website and you have to utilize only from that strictly allotted space. In this case, there will be a demand for resources as you can’t expand the server space awarded to each user.
  • Dedicated Server hosting – Your website will have its own server. You will be entirely responsible for your server as you won’t be sharing your resources, which speeds up the performance.
  • Cloud Hosting – In this case, your website doesn’t depend on just 1 server rather a lot of servers, hence the name cloud. You don’t have to feel for the resources as it is available across many web servers. There won’t be any bandwidth problems as this type of hosting lets you to handle the peak loads.

 

CDN – Content Delivery Network

You can access the files quickly when your server is hosted in a nearby location. Imagine you are several miles away from your hosting server, then what would you do for loading your website in that specified amount of time?

In this case, even if you enhance anything, the slow loading can’t be fastened.

One thing has to be done. You need to have a Content Delivery Network (CDN) for your mother hosting server and serve your website’s visitors with the fastest display.

This came into effect because of Google’s Page Speed factor. Mobile and Tablet users are also the reason for CDN existence, as they purely hang on to speed for everything.

Use of PHP – WordPress

Always remember one thing – the higher you are making your server to serve a user, the slower it will be responding.

You need to check, monitor your PHP scripts and ensure that they are updated and properly handled at regular time period. If this is done, naturally your webpages won’t experience a slower response from the server.

The server has to read and follow instructions of PHP every time you try to squeeze the contents to the customers. So it’s important that you have a thorough watch into this area too when it comes to SRT.

When it comes to server response time in WordPress websites, Plug-ins also plays an important role. To know more about the Plug-ins, refer the below link:

https://www.webspeedmaster.com/should-i-use-plugins-on-my-wordpress-website/

 

Cache

Another metric which is needed for a quicker display of your website is cache. This prevents the server from executing unwanted works.

You can try using WordPress Super Cache or W3 Total Cache to ensure a speedy response from the server when a request is made.

 

Are you using the right Web Server Software (WSS)?

There are many good WSS which comes free, I have listed you three of them below. It doesn’t matter what Web Server Software (WSS) you are using, it can be configured according to your needs.

Whatever you do, it should enhance your server response time and concerning the server software’s, three of them are given below:

  1. Apache web servers
  2. Litespeed web servers
  3. Nginx web servers

Apache – is the most used WSS and its free. It’s easily configurable and many might know how to deal with it. You need a lookup on the documentation when you have to have some changes depending upon your necessity. Coming to the run speed of PHP, it’s above average.

Litespeed –  They have both free and paid options. Litespeed performs pretty much better than Apache. Changing from Apache to Litespeed won’t be a bigger problem, as Litespeed is completely compatible with Apache (uses same “.htaccess” file). In this WSS, the run speed of PHP is the fastest among the other three web server software which is listed here.

Nginx – Nginx has the quickest Server Response Time, as it utilizes lesser resources. By doing this, it handles higher traffic rate than the other WSS naturally. It is a free web server. In this WSS, run speed of PHP is faster.

 

Why reduce Resource Usage?

Like I have already said, whatever you do should increase the server response time and reducing the use of the resource is one among the implementations.

By minimizing the utilization of the resource, you are creating enough space in your server thereby attracting more traffic. Also, the website loads quickly and serves every user.

Focus on reducing CSS, JS, etc..rather than creating pressure on the server side.

  • Unite external CSS files together – Unite two or even more CSS files together (Copy and Paste), as the use of several designs and themes might have separated all the CSS into many files.
  • Unite external Javascript files together – In a Similar manner to CSS, all Javascript can also be united together and it doesn’t affect any functions. You are actually reducing the load time of your web page by segregating all the JS files into one file.
  • Defer Images – Deferred images basically are downloaded after the initial load of the webpage. This actually helps the page to load even faster. This doesn’t download all the images instantly.
  • Inline Javascript and Inline CSS – If you unite and put both the CSS and JS in an HTML file, it is referred as Inline CSS and JS. You don’t need an external file for CSS and JS. Inline CSS, JS reduces the files that needed to be downloaded before displaying as in the case of external CSS.
  • Enable Keep Alive – Once you enable keep alive, you are further lessening the time taken for loading your web page by grabbing the HTML, CSS, JS files and images in an orderly fashion and not requesting the server for each and every load. In this case, you are using a fewer server resource. Not enabling Keep Alive will take enough time to load a page and an unwanted usage of the server resource.

You are highly recommended to follow the page speed norms and best practices.

This ultimately serves more and more customers in a much effective way.

 

Wrapping Up:

Try to reduce the work of your server and you will find your website quickly displayed all the time. As a matter of fact, server response time measures a much lesser proportion when it comes to serving your site to the customers. But there are many ways to increase your server’s performance.

Combine all the metrics which we discussed, such as database optimization, web hosting, web traffic handling, use of right web server software, CDN usage, PHP monitoring, cache usage, reducing the use of resources, and apply systematically using three mantras of gathering, fixing and watch over. Optimizing all the factors will naturally lead to a very quick load of your website.

Do this along with the page speed norms and you will personally experience it in fact. Basically, you are fastening the time of the server to respond to a request made by a browser and the result is, displaying your website in a lightning fast.

 

If you find this blog useful, please share it.

If you by any chance feel that I have missed anything, you are requested to post a comment, that way I strongly feel that many may get useful information.

You might have plenty of experience in fixing server response time. It is highly appreciable for sharing those for us.

Any specific thoughts, which has helped you to overcome Server response time issue?

Leave a Reply

Your email address will not be published. Required fields are marked *