开发者

Suggestions on slow loading sites/server

We have a cloud hosting account that gives us 2GB of memory and 3GHZ processor using cpanel and centos as the OS. The problem we are having is pages seem to load slow and not just for us. Others have mentioned its slow. But we only have one web application and the load is almost at zero with over a gig of memory showing still available. The web application uses a theme we bought at themeforest and it has a ton of css styling and javascript for curved corners, drop shadow etc. Im wondering if the template itself is causing the slowness because of it doing a lot of rendering via the browser? It seems faster on a desktop than on an ipad.

Is there any tools to determine any potential loading issues? Again we watch the load average while people use it and there is hardly any load yet from clicking from page to page it seems to take a few seconds to render. The page size shows under 2kb. When pinging the server it ranges 70-90ms and it takes 10-12 hops. Any suggestions a开发者_C百科t all?


A fantastic tool for diagnosing your bottleneck is the FireBug Net panel. Watch the timeline -- does the server take a long time to respond? Are we waiting a long time for resources? Or do we get everything we need right away, but there's still a long delay before the page is ready? (That would mean we have a performance issue on the client side.)

Are some resources blocking others unnecessarily? Be sure to include your CSS and Javascript in the right places. This seems a likely culprit. (See the performance tips from Yahoo and Google and get the associated Google Page Speed and Yahoo YSlow addons for Firebug.)

Are there lots of images, CSS and JavaScript files? Maybe the bottleneck is the number of connections per hostname. (See browserscope.org.) To check this, open the "Net" panel in Firebug. Clear your browser cache and load your page. How many files are being downloaded?

Blocking downloads and network bottlenecks are more likely culprits than CSS. Fancy Javascript effects could certainly slow you down, though.

To see if the CSS or Javascript rendering is slowing you down, try selectively disabling them and browsing your site. You can do this with the WebDeveloper addon.

Other factors in client rendering speed are the efficiency of the CSS selectors and the number of elements in your page.

var count = document.getElementsByTagName('*').length;
alert('The page has '+count+' elements.');

A large number of elements slows down Javascript execution, as well.


Sounds to me like you're not getting a dedicated 2GB of memory and 3Ghz processor. You're probably sharing those resources with a number of other sites. What hosting provider are you using?

Also, does your browser freeze while the page loads? For example, if you hover the mouse over the Back button while the page loads, does the button pop up? If the browser freezes while the page loads, then that points to issues with the page itself.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜