Why my WordPress Blog was too slow ?

Why my WordPress Blog was too slow ? post thumbnail image

WordPress is one of the best choice for writing blogs over internet. It empowers more than 43% of the websites on internet, as per online data available. I bought the domain name : ankitgupta.in few months back and at that time my vision was to create personal website which shows information about my professional career. I started with “Google Sites” which help me get my website up within few hours with a nice home page a good menu, but it was static and I couldn’t change a lot of things in the website. Certainly I wanted to grow the website to a point where it can showcase my achievements on regular basis. So, I moved to a free LAMP hosting 000webhost. The hosting was free and the website was up. For some reason it was slow and it redirected to secure http (https) URL which showed certificate error. Then one day I actively edited some of the pages on my website and it started showing error related to “Maximum requests to database got exceeded for this hour”. So, I left editing for 12 hours and came back but website wasn’t functional properly. My pages were not getting loaded. This was the time when I moved from free hosting to dedicated hosting (but not from 000webhost/Hostinger providers). Finally, I got a functional WordPress blog which look good, have more limits than a free hosting plan with a https enabled website.

I am writing blogs on my website (https://ankitgupta.in/) since last two weeks. The purpose of me writing blogs is to document my solutions to the problem I face on daily basis related to technology and day to day work. This way I can refer to the solutions in future for my own work and anyone who faces same issues can get benefited by the solutions I write.

I made some changes in WordPress configuration related to pages and posts. It was working fine. Slowly, it started getting slower then before, taking about 15 to 20 seconds to load a page. I wasn’t satisfied with writing posts on a slow website, it was taking a lot of time for saving draft and publishing. I wasn’t sure what was happening.

Now, I am fully involved in blogging, so I wanted the website response to be better. The main website is the WordPress blog which host other pages, so either the hosting could be the issue or WordPress site may have the issue. Following is how I diagnosed the issue.

Website Diagnosis using basic tools

I opened my website on browser and it was taking a lot of time to load my homepage, this wasn’t a normal behavior of the website. Having experience in Linux tools, I just tried to use some of them to know what could be the issue:

First I used dig command to know if my website isn’t having any issue related to domain name resolution:

dig ankitgupta.in

and the www subdomain:

dig www.ankitgupta.in

It was able to resolve my website to my ip address which was fine. Now I tried to download the home page of my website through wget and tried multiple set of URLs:

wget https://ankitgupta.in
wget https://ankitgupta.in
wget https://ankitgupta.in
wget https://ankitgupta.in

Now my website don’t show same result as below, but I have a photograph of my desktop when the issue was happening:

So let’s analyze the request started at 10:59:12 and got redirected to secure website on 10:59:13 which is fine and it must reach my content now but it again got 301 redirect which happened at 10:59:25 (took 12 seconds) and again the website responded in 10+ seconds. In total the website was giving 25 seconds of delay.

I couldn’t understand why my website redirected from https://ankitgupta.in to https://ankitgupta.in as this isn’t expected. I started checking the WordPress settings and could only fine https://ankitgupta.in in General settings set as following:

I was clear on the issue why my non-www website redirect to the Site Address set in wordpress. I wanted this setting to be blank in order to save redirect and also want to revert unwanted settings changes in wordpress, which ,might be making it slow. As I made many changes I wasn’t sure, so I backed up my website and loaded WPReset plugin and tried to reset the website. As it was too slow it was taking too much time and couldn’t complete properly but the site reset was able to fix my problem.

Now my website have following wget response:

So, website only got redirected once and responded in less than 5 seconds ( 3.287 second). So, now I can continue working and writing posts.

Further Changes:

I am not sure how different WordPress plugins work, but I thought it would be a good idea to install some plugins which help the website load faster. So, with some searches over internet I found that the JetPack Boost can help solve many of the issues related to slow WordPress websites so I installed it, activated and enabled some settings so that my website load faster.

I loaded other plugins like Smush, Hummingbird and LiteSpeed but I think loading more plugins for same task is a overkill. So, I have only JetPack boost enabled now.

Leave a Reply

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

Related Post