PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 12th, 2012, 05:30 AM
ttremain ttremain is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2005
Location: Vancouver, WA, USA
Posts: 364 ttremain User rank is First Lieutenant (10000 - 20000 Reputation Level)ttremain User rank is First Lieutenant (10000 - 20000 Reputation Level)ttremain User rank is First Lieutenant (10000 - 20000 Reputation Level)ttremain User rank is First Lieutenant (10000 - 20000 Reputation Level)ttremain User rank is First Lieutenant (10000 - 20000 Reputation Level)ttremain User rank is First Lieutenant (10000 - 20000 Reputation Level)ttremain User rank is First Lieutenant (10000 - 20000 Reputation Level)ttremain User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Days 7 h 49 m 59 sec
Reputation Power: 188
Slow loading page

I have a client, that has an issue with a few pages that load VERY slow. (20 to 30 seconds maybe)

checking microtime() at the begining and end of the page load only shows the elapsed microseconds to be 0.14907288551331 seconds.

This leads me to believe that I should be looking more to the .js libraries being loaded, a jquery codes. Does this sound logical?
__________________
Thomas Tremain

Reply With Quote
  #2  
Old November 12th, 2012, 06:50 AM
gw1500se gw1500se is online now
Contributing User
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Jul 2003
Posts: 2,879 gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 1 Year 2 Weeks 1 Day 15 h 14 m 45 sec
Reputation Power: 581
I'd suspect network latency first.
__________________
There are 10 kinds of people in the world. Those that understand binary and those that don't.

Reply With Quote
  #3  
Old November 12th, 2012, 06:52 AM
ttremain ttremain is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2005
Location: Vancouver, WA, USA
Posts: 364 ttremain User rank is First Lieutenant (10000 - 20000 Reputation Level)ttremain User rank is First Lieutenant (10000 - 20000 Reputation Level)ttremain User rank is First Lieutenant (10000 - 20000 Reputation Level)ttremain User rank is First Lieutenant (10000 - 20000 Reputation Level)ttremain User rank is First Lieutenant (10000 - 20000 Reputation Level)ttremain User rank is First Lieutenant (10000 - 20000 Reputation Level)ttremain User rank is First Lieutenant (10000 - 20000 Reputation Level)ttremain User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Days 7 h 49 m 59 sec
Reputation Power: 188
Quote:
Originally Posted by gw1500se
I'd suspect network latency first.


It happens on specific pages only.

Reply With Quote
  #4  
Old November 12th, 2012, 07:24 AM
gw1500se gw1500se is online now
Contributing User
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Jul 2003
Posts: 2,879 gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 1 Year 2 Weeks 1 Day 15 h 14 m 45 sec
Reputation Power: 581
Does it happen on all pages and only pages using .js libraries?

Reply With Quote
  #5  
Old November 12th, 2012, 01:33 PM
msteudel's Avatar
msteudel msteudel is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Sep 2002
Location: Seattle, U.S.A.
Posts: 712 msteudel User rank is Lance Corporal (50 - 100 Reputation Level)msteudel User rank is Lance Corporal (50 - 100 Reputation Level)msteudel User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 4 Days 11 h 4 m 59 sec
Reputation Power: 11
A good way to figure out whats going on is to use some sort fo browser based developer tool (Firebug, Chrome|Safari Developer Tools). You can see if there is something, like js library that is loading slowly. If you suspect its js loading you can also try and move all of your js libraries to the end of your page and see if that makes a difference or look into a js library that loads in your js last. This is a screen shot from chromes:

https://www.evernote.com/shard/s194...cd9eb2631a6642f

Also take a look at Yahoo's YSlow project. I think it comes bundled with firebug.

Reply With Quote
  #6  
Old November 13th, 2012, 03:34 AM
ttremain ttremain is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2005
Location: Vancouver, WA, USA
Posts: 364 ttremain User rank is First Lieutenant (10000 - 20000 Reputation Level)ttremain User rank is First Lieutenant (10000 - 20000 Reputation Level)ttremain User rank is First Lieutenant (10000 - 20000 Reputation Level)ttremain User rank is First Lieutenant (10000 - 20000 Reputation Level)ttremain User rank is First Lieutenant (10000 - 20000 Reputation Level)ttremain User rank is First Lieutenant (10000 - 20000 Reputation Level)ttremain User rank is First Lieutenant (10000 - 20000 Reputation Level)ttremain User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Days 7 h 49 m 59 sec
Reputation Power: 188
Thanks for your help folks. I was wrong on this after all.

I'd forgotten that when you view source with firefox it reloads the page instead of pulling it from memory. This means the timer figures I was looking at, were not from the original page view, and where mySQL was using cached values, therefore going a lot quicker.

Reply With Quote
  #7  
Old November 13th, 2012, 12:06 PM
piperpam27 piperpam27 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2012
Posts: 47 piperpam27 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 51 m 3 sec
Reputation Power: 1
Saw this presentation of Chris Coyier's the other day. It sounds like you have your issue solved, but this is still a good watch for anyone reading this thread who wants to know some simple ways to improve their load time.

http://css-tricks.com/video-screenc...ebsites-faster/
__________________
Laterna Studio - Animation, Web Design, Video Production and Print Design

Psalm 73: 25-26

Reply With Quote
  #8  
Old November 13th, 2012, 12:16 PM
msteudel's Avatar
msteudel msteudel is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Sep 2002
Location: Seattle, U.S.A.
Posts: 712 msteudel User rank is Lance Corporal (50 - 100 Reputation Level)msteudel User rank is Lance Corporal (50 - 100 Reputation Level)msteudel User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 4 Days 11 h 4 m 59 sec
Reputation Power: 11
That's a great vcast. Here's a list things you can check out I compiled from my local PHP meetup group:

Tools to Help Debug:
* Firebug[1]/Yslow [2], Google PageSpeed Extension [19]
* Use a code profiling tool ( XDebug[8], Webgrind [6], MacGDBp [7] )
* use mysql explain to identify if your queries are using indexes [11]

Backend
* Use gzip to compress output
* Check that server has appropriate CPU, RAM, Disk I/O available for traffic
* Optimize db query, proper indexing, joining
* Optimize php code
* Caching: Memcache [9], APC [10]
* Load balancing: web servers, db servers
* Separate out long running queries into individual tasks that can be
run on off hours or asynchronously
* Look into optimizing server configuration (trimming unneeded PHP
extensions, tuning mysql config, etc.)
* Switching to faster web server like NGix
* Use something like PHP-FPPM to make Apache run PHP faster [18]
* Thinking about changing some of your queries into stored procedures
that mysql can compile


Front End
* Minify Javascript/CSS files [3]
* JS codes at the bottom of page
* Important CSS files at the top
* Monitor 3rd party scripts (facebook buttons, twitter buttons, ad
networks). Consider async loading these after your page has loaded.[4]
* Add appropriate Expires or a Cache-Control Header[5]
* front end caching servers e.g. Varnish [12], Squid [13]
* css/image spriting [14]
* Progressive Jpgs
* Optimize (ie make smaller) your images, check out pngcrush [15] or
jpegran [16] for batch optimization
* Use Content Delivery Networks (CDN) [17]


Resources/Articles/Tutorials
* http://developer.yahoo.com/performance/rules.html/
* http://www.html5rocks.com/en/tutorials/webperformance/basics/

[1] - http://getfirebug.com/
[2] - http://developer.yahoo.com/yslow/
[3] - http://developer.yahoo.com/yui/compressor/
[4] - http://bit.ly/P6kde8
[5] - http://developer.yahoo.com/performance/rules.html/rules.html#expires
[6] - http://code.google.com/p/webgrind/
[7] - http://www.bluestatic.org/software/macgdbp/
[8] - http://xdebug.org/
[9] - http://memcached.org/
[10] - http://en.wikipedia.org/wiki/List_of_PHP_accelerators#Alternative_PHP_Cache_.28APC.29
[11] - http://dev.mysql.com/doc/refman/5.0/en/using-explain.html
[12] - https://www.varnish-cache.org/
[13] - http://www.squid-cache.org/
[14] - http://css-tricks.com/css-sprites/
[15] - http://pmt.sourceforge.net/pngcrush/
[16] - http://jpegclub.org/jpegtran/
[17] - http://en.wikipedia.org/wiki/Content_delivery_network
[18] - http://php-fpm.org/
[19] - https://developers.google.com/speed/pagespeed/

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > Slow loading page

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap