1

This has been extremely frustrating for us, our website is taking 40 seconds to load, and first time to byte is showing as 32 seconds on a Magento site. We are not sure what is causing this - back end seems to load OK, but frontend is taking forever. I am suspecting that is is a script issue.

http://www.webpagetest.org/result/140712_M8_GMP/

Can someone please help. How do we go debugging this? We have implemented that we can to improve the performance (like the tips about cleaning logs, compressing the javascript and CSS - did all that but undo it to show the scripts we are running) but 32 seconds seems like there's a major issue? How can we know if it's a server issue, or there's a conflict with the scripts we installed. Please help!

 <!--[if lt IE 7]> <script type="text/javascript"> //<![CDATA[
     var BLANK_URL = 'http://sitename.com/js/blank.html';
     var BLANK_IMG = 'http://sitename.com/js/spacer.gif'; //]]> </script> <![endif]--> link rel="stylesheet" type="text/css"
 href="http://sitename.com/skin/frontend/sitename_theme/default/css/font.css"
 media="all" /> <link rel="stylesheet" type="text/css"
 href="http://sitename.com/skin/frontend/sitename_theme/default/css/bootstrap.css"
 media="all" /> <link rel="stylesheet" type="text/css"
 href="http://sitename.com/skin/frontend/sitename_theme/default/css/ac-added.css"
 media="all" /> <link rel="stylesheet" type="text/css"
 href="http://sitename.com/skin/frontend/sitename_theme/default/css/bootstrap-responsive.css"
 media="all" /> <link rel="stylesheet" type="text/css"
 href="http://sitename.com/skin/frontend/sitename_theme/default/css/docs.css"
 media="all" /> <link rel="stylesheet" type="text/css"
 href="http://sitename.com/skin/frontend/sitename_theme/default/js/google-code-prettify/prettify.css"
 media="all" /> <link rel="stylesheet" type="text/css"
 href="http://sitename.com/skin/frontend/sitename_theme/default/css/diff.css"
 media="all" /> <link rel="stylesheet" type="text/css"
 href="http://sitename.com/skin/frontend/base/default/css/widgets.css"
 media="all" /> <link rel="stylesheet" type="text/css"
 href="http://sitename.com/skin/frontend/sitename_theme/default/css/cart.css"
 media="all" /> <link rel="stylesheet" type="text/css"
 href="http://sitename.com/skin/frontend/sitename_theme/default/css/amlabel.css"
 media="all" /> <link rel="stylesheet" type="text/css"
 href="http://sitename.com/skin/frontend/base/default/css/ajaxcartpopup.css"
 media="all" /> <link rel="stylesheet" type="text/css"
 href="http://sitename.com/skin/frontend/sitename_theme/default/css/mirasvit/searchautocomplete/amazon.css"
 media="all" /> <link rel="stylesheet" type="text/css"
 href="http://sitename.com/skin/frontend/sitename_theme/default/css/mirasvit_searchindex.css"
 media="all" /> <link rel="stylesheet" type="text/css"
 href="http://sitename.com/skin/frontend/base/default/css/j2t-rewardpoints.css"
 media="all" /> <link rel="stylesheet" type="text/css"
 href="http://sitename.com/skin/frontend/sitename_theme/default/css/easytabs.css"
 media="all" /> <link rel="stylesheet" type="text/css"
 href="http://sitename.com/skin/frontend/base/default/css/tegdesign_emailcollector/styles.css"
 media="all" /> <link rel="stylesheet" type="text/css"
 href="http://sitename.com/skin/frontend/sitename_theme/default/css/print.css"
 media="print" /> <script type="text/javascript"
 src="http://sitename.com/js/prototype/prototype.js"></script> <script
 type="text/javascript"
 src="http://sitename.com/js/lib/ccard.js"></script> <script
 type="text/javascript"
 src="http://sitename.com/js/prototype/validation.js"></script> <script
 type="text/javascript"
 src="http://sitename.com/js/scriptaculous/builder.js"></script>
 <script type="text/javascript"
 src="http://sitename.com/js/scriptaculous/effects.js"></script>
 <script type="text/javascript"
 src="http://sitename.com/js/scriptaculous/dragdrop.js"></script>
 <script type="text/javascript"
 src="http://sitename.com/js/scriptaculous/controls.js"></script>
 <script type="text/javascript"
 src="http://sitename.com/js/scriptaculous/slider.js"></script> <script
 type="text/javascript"
 src="http://sitename.com/js/scriptaculous/accordion.js"></script>
 <script type="text/javascript"
 src="http://sitename.com/js/scriptaculous/customquery.js"></script>
 <script type="text/javascript"
 src="http://sitename.com/js/scriptaculous/css_browser_selector.js"></script>
 <script type="text/javascript"
 src="http://sitename.com/js/varien/js.js"></script> <script
 type="text/javascript"
 src="http://sitename.com/js/varien/form.js"></script> <script
 type="text/javascript"
 src="http://sitename.com/js/varien/menu.js"></script> <script
 type="text/javascript"
 src="http://sitename.com/js/mage/translate.js"></script> <script
 type="text/javascript"
 src="http://sitename.com/js/mage/cookies.js"></script> <script
 type="text/javascript"
 src="http://sitename.com/js/mirasvit/core/jquery.min.js"></script>
 <script type="text/javascript"
 src="http://sitename.com/js/mirasvit/core/underscore.js"></script>
 <script type="text/javascript"
 src="http://sitename.com/js/mirasvit/core/backbone.js"></script>
 <script type="text/javascript"
 src="http://sitename.com/js/mirasvit/code/searchautocomplete/form.js"></script>
 <script type="text/javascript"
 src="http://sitename.com/js/mirasvit/code/searchautocomplete/autocomplete.js"></script>
 <script type="text/javascript"
 src="http://sitename.com/skin/frontend/base/default/js/ajaxcartpopup.js"></script>
 <!--[if lt IE 8]> <link rel="stylesheet" type="text/css"
 href="http://sitename.com/skin/frontend/sitename_theme/default/css/styles-ie.css"
 media="all" /> <![endif]-->

 <script type="text/javascript"> //<![CDATA[ Mage.Cookies.path     =
 '/'; Mage.Cookies.domain   = '.sitename.com'; //]]> </script>

 <script type="text/javascript"> //<![CDATA[ optionalZipCountries =
 ["HK","IE","MO","PA"]; //]]> </script> <script
 type="text/javascript">//<![CDATA[
         var Translator = new Translate([]);
         //]]></script>    </head>
     <body class=" cms-index-index cms-home">
         <!-- BEGIN GOOGLE ANALYTICS CODEs --> <script type="text/javascript"> //<![CDATA[
     var _gaq = _gaq || [];

 _gaq.push(['_setAccount', 'UA-23681830-1']);
 _gaq.push(['_trackPageview']);

     (function() {
         var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
         ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
         var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
     })();

//]]> </script>
3
  • A simple look at the developer console would show you all those 404's and "Connection Refused" errors. I would suggest fixing those first. Outside of that, this question would require diagnostic work that is more along the lines of something you should hire a developer for.
    – pspahn
    Jul 12, 2014 at 20:55
  • 2
    You are running on SiteGround, you get what you pay for. Magento hosting should be 0.5-1% of revenue and needs to be under 3s dynamic page loads. Around 95% of sites will never make that - SiteGround is a Tier 7 provider the lowest tier - Nexcess Tier 3/4 the best for Magento - we use Tier 1/2.
    – user2935
    Jul 12, 2014 at 21:28
  • Shall we know what are all the steps you followed, for our knowledge? @Kohn
    – Gem
    Sep 6, 2018 at 7:14

2 Answers 2

6

If you're having 30 second "FTTB" then it's not a javascript problem. The web browser needs to download javascript files, same as any other. "FTTB" happens earlier in the process.

First, test how long it takes apache to response to a redirect request. This will let you know if there's a non Magento/PHP problem

$ date;curl http://acgears.com/media;date
Sat Jul 12 15:03:15 PDT 2014
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="http://acgears.com/media/">here</a>.</p>
<hr>
<address>Apache/2.2.24 (Unix) mod_hive/3.6 mod_ssl/2.2.24 OpenSSL/1.0.0-fips mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 mod_fcgid/2.3.6 Server at acgears.com Port 80</address>
</body></html>
Sat Jul 12 15:03:16 PDT 2014

Above we've requested the URL http://acgears.com/media. Apache should always redirect this to http://acgears.com/media/. We've wrapped the curl call in a call to the date command. This will give us rough timing. As you can see, this is taking less than a second, so that's not your problem.

Next, request a static file you know exists. This is another check to make sure the web server is running normally.

$ date;curl 'http://acgears.com/js/prototype/prototype.js';date;
Sat Jul 12 15:06:30 PDT 2014
/*  Prototype JavaScript framework, version 1.7
 *  (c) 2005-2010 Sam Stephenson
[...]

Sat Jul 12 15:06:30 PDT 2014

Again, timing here seems normal. Finally, request the homepage and see how long a Magento bootstrapped request takes.

$ date;curl 'http://acgears.com/';date;
Sat Jul 12 15:08:00 PDT 2014
[...]
Sat Jul 12 15:08:35 PDT 2014

So there's your problem. Without any javascript, Magento's literally taking 30-ish seconds to render a page. I'd disable all your custom functionality and/or install a stock Magento to see if it shows the same behavior. It not, reenable modules one-by-one until you find the culprit. You also might google around for profiling Magento.

My guess if you're on a server without the specs to run Magento. Magento has a unique performance profile among PHP applications. Most standard shared hosting outfits make their money hosting static and/or Wordpress sites that don't get any traffic. These companies either can't handle Magento hosting, or say they can so they can bait/switch you up the chain to a more powerful hosting plan.

2
  • Thank you so much Alan! According to our host provider this is caused by very large MySQL which is running inefficiently and also Javascripts that's having a lot of redirecting. However, if according to you without running any Javascript it is already loading 30 seconds, could this be a MySQL situation?
    – Kohn Liu
    Jul 13, 2014 at 3:17
  • Here's what our host provider wrote - is this what's causing the issue? it appears that your website's database is ratehr large (almost 3GB) and it is generating slow queries, some of which are reaching almost 4 minutes to execute: Code: Executed 122 min ago for 222 sec on Database --> acgears9_mag. SELECT core_url_rewrite.* FROM core_url_rewrite WHERE (request_path IN ('administrator/index.php', 'administrator/index.php/')) AND (store_id IN(0, 1 Please note that a MySQL query is considered slow if it exceeds 1 second when it is executed.
    – Kohn Liu
    Jul 13, 2014 at 3:38
0

I use this tools to identify which query caused slow load

https://github.com/mgtcommerce/Mgt_Developertoolbar

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.