How can I speed up the site?

hello,
checked in gtmetrix the site performance and see this:

I see that the logo and social media icons slow down the site. Is there any way to improve it? I installed W3 Total Cache, it helped a little bit but it did not save me totally.
Appreciate your advice.
The site: www.publicdifferent.com

I checked your site after 3 AM EST and it loaded in about 13 seconds first load. I also tested using tools.pingdom.com which showed a load time of 1.93 seconds (much faster than I could get it). Web server traffic is low this time of night. So this may be as good as it gets.

Looking at your test results, your png images are coming down a little slow (but not too bad). Have you had this problem for long? It may be your web server is a little slow temporarily, overloaded, or a temporary bottleneck in the data center your server is in. Doing a lookup on the IP, it looks like you are hosting on one of those “unlimited” web hosts. Are you? Don’t expect too much performance from an “unlimited” web host. Those hosts appeal to the lower end that wants to use a server for all it is worth while paying as little as possible. Poor performance is a well-known consequence of using an “unlimited” web host.

To get an idea if the server may be overloaded, I found some more websites hosted on the same IP address as yours. All of them loaded dismally slow. To be fair, this time of night the server may be performing backups or maintenance functions. I’ll try to check it again later during mid day and see how it does.

One more thing I wanted to mention is that there is a whole lot of odd looking comments in your HTML about your caching plugin. I am not familiar with W3 so I do not know what is normal.

Check your server load. If you are using cPanel, there should be a way to do that on the left at the bottom when you first log in. You can also get it using

(http://php.net/manual/en/function.sys-getloadavg.php).  I have a feeling your server load may be high.

Thank you, @cheesedude! Indeed, I have principal domain and its addons hosted by justhost, I liked their customer service, and price I guess. Who can you advice from your own experience to have better speed? As for portfolio site and for ecommerce.

Could you please explain how can I check my server load using cPanel?

On the left side of the main page when you log into cPanel you will see at the bottom “Service Status Click to View”. Click that. Look for the line that says “Server Load”.

A general rule of thumb is that a load of 1 or less per CPU core is acceptable. If you are on a server with one quad core CPU, that’s 4 cores so a server load of 4 or less would be acceptable. If you were on a dual core server with hex core CPUs (2 physical CPUs with 6 cores each CPU for a total of 12 cores), a load of 12 or less would be acceptable. A server may perform without any noticeable lag with a server load above 1 per core. The “load of 1 per core” rule of thumb is not an absolute rule. But there comes a point where server load does impact performance. So it’s a good idea to see what your server’s load is as it may explain your page load issues. For some reason when cPanel lists the number of cores next to the load average it lists the total number of virtual cores. For the shared server I am on, it is double the number of actual cores.

You can also stick this code in a PHP file, navigate to it using your browser and it should output the 1, 5, and 15 minute load averages along with some CPU info.


<!doctype HTML>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>CPU Load Averages &amp; CPU Info</title>
</head>
<body>
<h1>Server Load Averages</h1>
<?php
$arr_load_avg = sys_getloadavg();
?>
<p>
1 minute average: <?php echo $arr_load_avg[0];?><br/>
5 minute average: <?php echo $arr_load_avg[1];?><br/>
15 minute average: <?php echo $arr_load_avg[2];?><br/>
</p>
<?php
if (exec('lscpu', $cpu_info))
{
    echo '<pre>';
    foreach ($cpu_info as $key => $val)
    {
        echo $val . "\
";
    }
    echo '</pre>';
}
else
{
    echo 'Could not retrieve CPU info.';
}
?>
</body>
</html>

It looks like the total number of cores is the “Core(s) per socket:” multiplied by the “Socket(s):” number. The Sockets number gives the number of CPUs. Let’s see what you have.

Your website load performance is even worse right now at 9:45 EST. As a rule, I am not a fan of “unlimited” web hosts and if you are serious about hosting your sites, I recommend a fixed limit web host. That’s the kind I use. If you need a recommendation I can recommend the one I use. Otherwise, search for a fixed limit host. I can’t tell you how many times I have seen people complaining about poor load performance on “unlimited” hosts.

Edit: A tools.pingdom.com load test just now took 42.57 seconds to load the page and content. Of that, 31.21 seconds was the “connect” time. I don’t know why that is so long unless there is a DNS problem as well.

@Cheesedude, I’m still digesting the information.
I looked at the cPAnel, did not find the information you was talking about (Service Status Click to View), than contacted my hosting company, they said this information is not available via cPanel :frowning: So I’m stuck. I dont know how should I add the php file to my server. Could you please explain?

Cant I see some helpful information about cores in CPU Throttling History?

By scrutinising my cPanel, I also found that I have this message:
Your account contains more than 9740 directories and may pose a potential performance risk to the server.<br>Please reduce the number of directories for your account to prevent <em>possible</em> account deactivation.

Could this slow down my site performance?

I do not know how you get a message saying you have 9740 directories when you only have about 11 pages!
Perhaps that’s all the directories on the server?

Save cheesdudes code as a file and call it something like load.php, upload that file to your server and the go to that page e.g. www.publicdifferent.com/load.php

I cannot say I am surprised that an “unlimited” host would not want their customers to know what the server load is.

Sure. Take the PHP code below (I have since updated it) and copy and paste it into a text file (such as Notepad on Windows or any other text editor program). Save the text file as load.php (or another name of your choosing such as server_load.php, etc.). Then upload the file to your server using cPanel’s file upload feature or FTP. Upload the file into your root folder for your website (which may be public_html if that is your only website on your account).

Then type into your browser: publicdifferent.com/load.php (or whatever you named the file). Your browser will request the PHP file which will then run on the server and return the HTML to your browser. The script will attempt to retrieve the system load averages and then attempt to retrieve the CPU info for the server your website is hosted on.


<!doctype HTML>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>CPU Load Averages &amp; CPU Info</title>
</head>
<body>
<h1>Server Load Averages &amp; CPU Info</h1>
<h2>Server Load Average</h2>
<?php

//  Check to see if sys_getloadavg function exists.  If so, run it to get system load averages.
if (function_exists('sys_getloadavg'))
{
  if ($arr_load_avg = sys_getloadavg())
  {
    echo '<div>';
    echo '1 minute: ', $arr_load_avg[0], '<br>';
    echo '5 minute: ', $arr_load_avg[1], '<br>';
    echo '15 minute: ', $arr_load_avg[2], '<br>';
    echo '</div>';
  }
  else
  {
     echo '<p>Could not get load averages.</p>';
  }
}
else
{
  echo 'Could not get load averages.  sys_getloadavg() function may have been disabled.';
}

echo '<h2>CPU Info</h2>';

//  Run a system command to retrieve CPU info.  Check to see if exec function exists first.  It may be disabled for security purposes.
if (function_exists('exec'))
{
  if (exec('lscpu', $cpu_info))
  {
    echo '<pre>';
    foreach ($cpu_info as $key => $val)
    {
        echo $val . "\
";
    }
    echo '</pre>';
  }
  else
  {
    echo '<p>Could not get CPU info.</p>';
  }
}
else
{
    echo '<p>Could not retrieve CPU info.  exec() function may have been disabled.</p>';
}

?>
</body>
</html>

You may want to copy and save the HTML output after running the script so we can see it. You can paste it back into your reply. As I mentioned earlier, a load average of 1 per core is considered acceptable. A little over that is nothing to be concerned about. If the load gets too high, server performance will suffer and often result in slow page loads.

No. That will just show you when the system limited your account for consuming too much CPU resources.

No. That will not impact your site’s load performance. As I mentioned, the night I checked it I looked for more websites hosted on the same IP address and they all loaded slowly. I checked your site again about 24 hours ago and it loaded pretty fast. I checked a few minutes ago and it loaded in about 9 seconds. The real test is during peak internet traffic which is in the late afternoon here in America (about 4 PM - 6 PM New York time).

I copied your code, created server_load.php and uploaded it into public_html folder via FTP. I dont know what I have done wrong but it didnt show me any html code just normal Page not found something. I did screenshot http://imgur.com/oqHDZTK What I have done wrong? Thank you!

publicdifferent.com/server_load.php

I accessed the file just fine (you named the file with an underscore but typed a dash into your address bar). Your server is SEVERELY overloaded. Worst I have ever seen. Right now in America it is almost midnight EST Sunday Night. Web traffic is probably as low as it gets right now. This is your server’s load averages:

Server Load Averages & CPU Info
Server Load Average
1 minute: 56.98
5 minute: 49.06
15 minute: 52.9
CPU Info

Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 20
On-line CPU(s) list: 0-19
Thread(s) per core: 1
Core(s) per socket: 2
Socket(s): 10
NUMA node(s): 1
Vendor ID: AuthenticAMD
CPU family: 21
Model: 1
Stepping: 2
CPU MHz: 2200.024
BogoMIPS: 4400.04
Hypervisor vendor: KVM
Virtualization type: full
L1d cache: 64K
L1i cache: 64K
L2 cache: 512K
NUMA node0 CPU(s): 0-19

Your server has a sustained 15-minute load average of 52.9. On a Sunday night. Server load will be worse during the work week at peak time. I cannot tell how many cores/CPUs your server has. It looks like your server is using AMD CPU and possibly operating on a virtualized server setup. I don’t know exactly what the deal is. Since I cannot decipher the CPU info, I’ll focus on the part that says “CPU(s): 20” and with a load average of 52.9 on a Sunday night, your server is severely overloaded.

Unfortunately, this is the kind of performance we see all to often on oversellers promising “unlimited” resources. Your website’s performance is going to be slow with a server load that high. Hosts promising “unlimited” appeal to those who want to hammer the server for all they can get away with and it looks like you have some real resource hogs on your server.

Here is the server load on the shared host I am on taken seconds after I checked yours:

Server Load Averages & CPU Info
Server Load Average
1 minute: 1.61
5 minute: 1.97
15 minute: 2.21
CPU Info

Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 24
On-line CPU(s) list: 0-23
Thread(s) per core: 2
Core(s) per socket: 6
Socket(s): 2
NUMA node(s): 2
Vendor ID: GenuineIntel
CPU family: 6
Model: 44
Stepping: 2
CPU MHz: 2399.848
BogoMIPS: 4799.87
Virtualization: VT-x
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 12288K
NUMA node0 CPU(s): 0-5,12-17
NUMA node1 CPU(s): 6-11,18-23

Do you see the difference in load average between yours and mine? 52.9 on your server, 2.21 on mine. That is why my pages load fast and yours load slowly.

My host is A Small Orange. They are very good. They don’t do “unlimited” web hosting. For $5 a month you can get much higher quality hosting than you are getting right now. And you can pay month-to-month meaning you can bail at any time without fear of losing anything in a long-term contract. Do yourself a favor and check them out (and any other fixed-limit hosts you can find if you want to spend the time looking around).

A disclaimer: A Small Orange and your current host are owned by the same parent company. They operate as separate hosting companies with separate management. The parent company is owned by some private equity firms and they have been gobbling up hosting companies but operating them separately. They target different segments of the hosting market and as you can see, perform much differently.

Find a fixed-limit host and you will have much better performance. If you are going to try to get clients, you are not going to make a good impression with a slow-loading website. Nobody is going to wait 40 seconds for a page load. My experience hosting with an overseller is the same as yours. Those types of hosts are fine for a certain segment of customer. If your website is important to you, I would recommend a fixed-limit host over an “unlimited” host any day. We see this server overloading with “unlimited” hosts all the time.

It is 3:43 AM EST here in America and here is the original poster’s server load right now:

1 minute: 85.93
5 minute: 76.38
15 minute: 65.28

I can’t wait to see it 12 hours from now at peak internet traffic.

The original poster’s server load went higher as I thought it might. This is the highest I’ve seen so far today at 11:51 AM EST:

1 minute: 140.48
5 minute: 164.85
15 minute: 147.24

That’s about triple the severely overloaded figures from the first time I checked late Sunday night.

This is the load on a shared server at my host at the same time:

1 minute: 1.88
5 minute: 2.55
15 minute: 2.83

Quite a difference. I’ve been on that server for 16 months and have never seen it overloaded.

I don’t know how any host can charge money for such an overloaded server. It’s downright shameful to operate like that. But at least now you know what is causing your poor page load performance.

It’s a disaster. I would definitely look to transfer my sites from justhost this weekend.
I have publicdifferent.com as primary site, and 5 different sites that justhost added as addons to publicdifferent.com I presume that addons slow or are being slowed mutually by the effect being attached to publicdifferent.com?
I looked at A Small Orange and read some reviews about them, I think I’m gonna move my two sites there, I’ll see later for three others… As I understand their “shared” hosting, for exemple for $5 per month + fee for domain is a same “shared” and unlimited hosting as justhost?

Your main site and your add-ons and every other customer’s account on the server is slow due to server overloading. When the server is overloaded, everything on it performs badly.

No, not “unlimited” disk space and transfer. It’s a fixed-limit host. $5 a month gets 1 GB of space and 20 GB of data transfer. That’s all you get. You want more, you have to upgrade to the next highest shared plan or pay for overage. That small plan can easily serve 20,000 - 40,000 visitors per month if you are not doing file downloads or hosting lots of images. There are bigger shared plans available than the $5 account. You can host as many domain names on the plan as you want within your limit. I have at one point or another had upwards of 7 websites hosted on a small account. You can have more than that within the limit. That is, all of your websites on the account share the 1 GB of disk space and 20 GB of data transfer. A $10 plan offers 5 GB of disk space and 100 GB of monthly data transfer. I hope that is understandable. :slight_smile:

Your experience with an “unlimited” host is extreme, but poor performance is something I have read about a lot of with them and have experienced myself. If you want a good host, whatever you choose, I recommend a fixed-limit host. Customers on fixed-limit hosts do not have the incentive to abuse the server for all they can get away with because they cannot. Their accounts have a limit. On your “unlimited” host, you can see how bad server performance is as the incentive is for the customers to use as much as they can. Also, if you are a fledgling web designer, you need a good host because your website is going to make an impression on potential customers.

Realistically estimate how much disk space and data transfer you need then go from there. People have a tendency to over-estimate how many visitors they are going to get. Start with a basic plan and if you need to upgrade later, you can do so.

Good hosting is worth it. You will notice a big difference in performance. If you want to go with another “unlimited” host, you could try looking at HostGator. However, I would hope you have learned a lesson about the “unlimited” oversellers and how bad they can be.

Here is your server load right now:

1 minute: 82.83
5 minute: 81.07
15 minute: 71.86

Here is mine on a fixed-limit account at A Small Orange.

1 minute: 2.55
5 minute: 2.37
15 minute: 2.33

Good luck. :slight_smile:

hello @cheesedude,
I live now at A Small Orange, so far I moved only one account to test and so far so good:

here is server load speed:
http://soapmarine.com/server_load_soapmarine.php youuuhouuu!

1 minute: 2.15
5 minute: 1.65
15 minute: 1.5

Big improvement from a server load of 164.85, isn’t it? :slight_smile:

You are getting some 404 page not found errors on your secondary URLs. Did you move your entire Wordpress database? Moving Wordpress is not too hard, but it can be tricky if you have never done it before.

http://codex.wordpress.org/Moving_WordPress

Also, I see you are using W3 Super Cache. How much traffic are you getting across your Wordpress sites? Because if you are low traffic, you can probably disable the caching plugin. If you have heavy traffic, you may want to keep it. Otherwise, it just adds complications that you really don’t need on a decent web host. Wordpress is a resource hog, that’s a fact. If you are only getting a few hundred visitors per day you can probably shut off the caching plugins because they will be more trouble than they are worth.

Thank you, cheesedude! Very handy advice! I activated W3 Super cache because I wanted to speed up the site load. Wrong approach to solve this problem, now I see :frowning: I’m happy now with server load, and going to move publicdifferent.com website as well.

Yes, I moved the wordpress database and it’s very painful for me everytime, this was super simple one-language site and it’s mine, so I can live with it and fix it when I have time. But for client’s sites it’s a real pain for me, especially I live in Europe and I’m asked to do multi-language sites. Moving databases freaking me out :frowning: Did not now that I have secondary permalinks broken. Damn it! I didnt check all the links one per one, after move. How did you spot them?

Can I ask you something? How do you insert code here in forums like you did in this thread? :slight_smile: I tried to do it here but it spread the code everywhere and it hard to read, maybe that is why I dont have any replies to my topic :frowning:

As cheesedude’s offline just now, I’ll jump in and answer a couple of points. :slight_smile:

I use gURLChecker to check site links. It’s only available for Linux, but I expect there will be something similar available for other OSs. There are certainly online tools available: http://www.everyclick.com/search?keyword=broken+link+checker

Use the # button at the top of the “basic” reply window to wrap [noparse]


[/noparse] tags around your code. If you want to highlight a specific syntax, click the “Go Advanced” button in the lower right-hand corner, which will take you to an interface with more options. The Syntax drop-down menu contains all the options. (You can also just type in the tags by hand, of course - if you can remember them. :))

Xenu is a popular link checker for windows and I have also used LinkChecker.

Thank you, Technobear! Today I definitely learn something. And thank you for correcting my other thread :slight_smile: Hm, hm as you are much experienced php kung-fu panda than I, maybe you can point me to the right direction in my problem? You can also punch me, if I’m bad student :slight_smile:

I went to your home page and clicked on one of the links from the front page:

soapmarine.com/portfolio/ecommerce

Did you change your permalink structure at all or do any other config changes? Because doing a search for the letter “a”, I could find your post content but clicking on the URLs are led to error messages.

Give this a read:

http://codex.wordpress.org/Moving_WordPress

Moving your domain without changing the Home and Site URLs of your WordPress site is very simple, and in most cases can be done by moving the files.

Moving a website is not that hard, but it can be a little scary if you are not used to it. It is just files on a server that can be downloaded using FTP or, if you have a decent control panel, compressed into one archive and downloaded to your computer then re-uploaded to another server. phpMyAdmin is the database tool frequently used to export databases. Same thing, export your databases, download them to your computer, then upload them to the new server.

It’s a pretty easy process. The trouble spots come in creating a new database(s) at the new host and updating the Wordpress config file if the database user name or password changes. Another complication can arise with plugins as some of them may store file paths or URLs in the database that may change when moving to another server.

I would advise you not to delete anything from your old host until you are set up at your new host. Do not delete any files or databases. Then see this:

https://help.asmallorange.com/index.php?/Knowledgebase/Article/View/288/0/moving-your-wordpress-site-to-a-small-orange

Note: if your current host is a cPanel host, the easiest thing to do is to allow one of our talented Tech Support Ninja’s take care of it for you. Just open a ticket and they’ll get it moved over for you.

I think your old host was using cPanel, right? If you deleted anything from your old host, you will not be able to take advantage of that. However, it is important for you to learn how to do this so you should probably take a stab at doing it yourself (if you are willing).

How many sites do you have to move? Because you are using plugins which may (or may not) store file path information in the database that can change on a new server. So I would advise to move each site one-by-one. And before you prepare to move the site from your old host, disable all plugins first, then download the files and export the database. You can re-enable plugins when you get everything uploaded and imported at the new host.

You may also want to take a look at this Wordpress migration plugin. I have never used it, but the reviews of it are all positive.

https://wordpress.org/plugins/all-in-one-wp-migration/

To use that, it looks like you: install it at old host and download an archive of your Wordpress site. Then on your new host, you would do a fresh install of Wordpress, install that plugin into your fresh install, then run the plugin to import the archive of your old site. It may be worth a few minutes for you to look at it.

Always keep backup copies of your websites. When you get everything set up at your new host, spend three or four minutes making backups of everything. Compress your public_html folder using the cPanel File Manager and then go into phpMyAdmin to export all your databases (you should be able to do this all at one time), and download them to your computer. Then also make another copy of that backup copy.

Years ago I lost many hours of work when my hard drive failed. Now I make lots of backups. For my most critical stuff, I have the copy on the web server, the copy on the hard drive, and copies on two thumb drives and two external hard drives. :slight_smile: