• Status: Solved
  • Priority: High
  • Security: Public
  • Views: 103
  • Last Modified:

Reduce Server Response time - Website load time

I have a website on a self hosted centos server. When doing a page speed test through google I get a message that it takes 5.8 seconds for the website server to respond where it is supposed to respond within 200ms. How do I get to the bottom of this load time?

We staged this website on another URL on a shared hosting server with much less resources but it performs much better.

WHM Centos Version : 68.0.36
Apache : 2.4.27
SQL : 5.6.38

Problem URL : www.luckystar.africa ( 5.8 server response )
Staging Server : www.madproducitons.co.za ( 800ms server response )
0
Leroy Luff
Asked:
Leroy Luff
1 Solution
 
theGhost_k8Database ConsultantCommented:
Why this is being printed --> "echo do_shortcode('[sg_popup id="3"]');"
0
 
Lucas BishopClick TrackerCommented:
Self-hosted, as in you are hosting it on an IP at your office/home? If so, the difference in response time is likely related to network latency.

Web hosts generally are located inside of a data center that is directly connected to the Internet backbone:
https://en.wikipedia.org/wiki/Internet_backbone

Backbone speeds can be in the Tbps range.

Your Internet connection at home/office is generally on last mile connection and will hav a very slow upload/response speed:
https://en.wikipedia.org/wiki/Last_mile

Last Mile speeds are usually in the Mbps range.

Google Speed Test is hosted on the backbone. A backbone to backbone test will be blazing fast. A backbone to last-mile test will be slow. The two can't be compared. The server hardware/resources will barely factor in the test, as the network connections are vastly different.

On top of that, if you lookup the IP of both domains listed above. One is hosted in Gauteng, Johannesburg and the other is located in Phoenix Arizona. The proximity of the speed-test server, to the tested IP, will also play significantly into the difference in response time, even if the two hosts have the same network/hardware performance.
2
 
Leroy LuffHead of IT & DIgitalAuthor Commented:
@Lucas I only meant it is on a self managed server. It is a hosted server at domains.co.za. The ip points to Arizona because we make use of cloudflare. The site should be available on a CDN network. I.e if I am in johannesburg i should get it loaded from cloudflares JHB server and not Arizona.

@ KV - We had some issues with a popup and I think the dev's enabled verbose or something. That still has to be cleaned up.
0
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

 
Lucas BishopClick TrackerCommented:
Put both domains through the speed test at https://tools.pingdom.com and use the same location for both. I used the NY server.

One thing you'll notice is that www.luckystar.africa domain takes almost 4 seconds to 301 redirect to the non-www version, when tested from New York:
pingdom test of www version
If you test from Sweden, that redirect takes almost half as long.

In any event, that redirect seems to be a problem.

However, even if you test the non-www version (to exclude the redirect), from Sweden, the time waiting to receive the initial html file is really long:
pingdom test of non-www version from Sweden
However, you mentioned that your developers have enabled a different configuration on this version of the site. Is it the same as the one your testing against? If not, that's an issue. Also, the file sizes of the main html file appear to be different between the two servers.

You have a lot of different variables here. You should equalize the ones you have control over (file sizes, php code, etc.), otherwise you're shooting in the dark.

Then start testing to see where the slowdown is. It could be one server is absolutely at max capacity and the other isn't. Could be a specific server in the route is a problem. Could be geo-location of the test. etc.
0
 
David Johnson, CD, MVPOwnerCommented:
If I disable the cache the sites are comparable 14.7 seconds
Cache Enabled
FAST Site 1.6 KB Transferred
Slow Site 28.8 KB Transferred

optimized files for both sites
https://drive.google.com/open?id=1j2YafmjnqB9xLGayI6JZyCbRuLhIOsMV
0
 
Leroy LuffHead of IT & DIgitalAuthor Commented:
As far as I know the websites should be exact duplicates.

Only the server hosting it is different - Ironically the server hosting the slow site is much more powerfull than the one hosting the fast site.

Please bear with me as I am no Guru.

* Could the issue be at DNS level?
* Could the issue be tat server level with regard to software vesions of sql/php/apache etc.
* Could the problems be couldflare taking longer to resolve the server with the slow website than the server with the fast website?
* Could the problems be that the actual php/wordpress files are different?
0
 
Lucas BishopClick TrackerCommented:
The fact that a 301 redirect is taking upwards of 4 seconds, makes me think the "fast" server is at capacity. Is it a shared host?
0
 
Lucas BishopClick TrackerCommented:
I meant the slow server.
0
 
Leroy LuffHead of IT & DIgitalAuthor Commented:
No it is a self managed host. How do i test the load on the server to rule that out?
0
 
Leroy LuffHead of IT & DIgitalAuthor Commented:
The server load is between 2.6 and 3.2 and i have 6 CPUs. This tells me the server is at 50% load cpu wise?

The memory is at 28%. 2.3 of 8 is being used.
0
 
Leroy LuffHead of IT & DIgitalAuthor Commented:
I have a suspicion that it might be the software vesions.

Apache : 2.4.27  > Any concerns to upgrade to version 4?
SQL : 5.6.38 > Any concerns to upgrade to mariadb10?

I have other websites on this same server and they take +- 1 second to respond but they are not near the same size. Not sure what this means for me though...
0
 
Leroy LuffHead of IT & DIgitalAuthor Commented:
Could it be DDOS attacks that is slowing down the network capacity of the server? Is there any way of checking this?
0
 
Leroy LuffHead of IT & DIgitalAuthor Commented:
Hi Everybody,

Thank you for taking the time to give input.

I have managed to track down the issue.. Druuuum Rolll.....

It was a plugin causing the issue : Wordfence. One of those plugins that you are damned if you use it and damned if you dont.

Anyways how do i close the questions or do i just choose a help candidate to get the points?
0
 
Lucas BishopClick TrackerCommented:
You can select your own comment as the answer to the question if I recall correctly.

Out of curiosity, was wordfence only installed on one of the two versions of the site?
0
 
Leroy LuffHead of IT & DIgitalAuthor Commented:
Thanks for all the assistance EE.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now