943,587 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 2424
  • PHP RSS
You are currently viewing page 1 of this multi-page discussion thread
Jun 16th, 2009
0

Site is taking a long long time to load.

Expand Post »
Hi,

I have uploaded a web site on the server then I hav tested it on the browser but it is taking a lot of time to load its contents. I dont have anything heavy in the site, does anybody know any solution to overcome this problem??

Please reply.
Take care.
Coolmind
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
coolmind259 is offline Offline
34 posts
since Apr 2009
Jun 16th, 2009
0

Re: Site is taking a long long time to load.

sometimes it happens when your mysql query goes in infinite loop.
carefully check all the queries.
Reputation Points: 15
Solved Threads: 6
Junior Poster
navi17 is offline Offline
118 posts
since Oct 2007
Jun 16th, 2009
0

Re: Site is taking a long long time to load.

Do you have any js-based analytics or advertising etc.? These can really slow down sites - I had to remove some of them from mine.

Is the slow load experienced on every computer or on every browser?

Have you pruned the page to various stages of undress to see which component is causing the delay? As prev. mentioned,loops (especially nested loops) may be the cause of your woes.

Do you have hundreds of people viewing your site at any given time? Is your server up to the task?

You could time certain procedures with microtime(), to give you a list:

PHP Syntax (Toggle Plain Text)
  1. $start = microtime(true);
  2.  
  3. //YOUR PROCEDURE e.g. loop
  4.  
  5. $end = microtime(true);
  6.  
  7. $elapsed = $end - $start;
  8.  
  9. echo "Procedure 1 = {$elapsed} seconds";
  10.  
  11. //repeat as necessary
Last edited by ardav; Jun 16th, 2009 at 12:47 pm. Reason: added bit of code - microtime()
Sponsor
Featured Poster
Reputation Points: 1046
Solved Threads: 942
Sarcastic Poster
ardav is offline Offline
6,661 posts
since Oct 2006
Jun 16th, 2009
0

Re: Site is taking a long long time to load.

What system is the website running on?

You can use the following commands to find this out:

php Syntax (Toggle Plain Text)
  1. echo "Site Software: ".$_SERVER["SERVER_SOFTWARE"]."<br />";
  2. echo "Proccessors: ".$_SERVER["NUMBER_OF_PROCESSORS"];

If the proccessor returns something silly like 1 then that might be an issue (these things can take allot of proccessing) but this wouldn't be the main issue.

Does your site finish loading or does it take soo long you give up? If this is the case AND the site software is Windows IIS then it could mean you need to configure IIS to accept PHP extensions.
Reputation Points: 31
Solved Threads: 27
Unverified User
Josh Connerty is offline Offline
342 posts
since Apr 2009
Jun 16th, 2009
0

Re: Site is taking a long long time to load.

Be sure that all images, style .css files and .js files load fast. Add some code to your index.php file to see <URL SNIPPED>server-side page generation time. Loading time, data transferring speed and page generation time are different things.
Last edited by peter_budo; Jun 17th, 2009 at 4:11 am. Reason: Keep It Spam Free - Do not spam, advertise, plug your website, or engage in any other type of self promotion.
Reputation Points: 8
Solved Threads: 0
Newbie Poster
AaliyahRoma is offline Offline
2 posts
since Apr 2009
Sep 26th, 2009
0

Re: Site is taking a long long time to load.

Hi There,

I am using .htaccess file in my site. I have defined .htaccess rules for each file seprately, does this slow slow down the loading speed of the site??

Please reply
Coolmind
Reputation Points: 10
Solved Threads: 0
Light Poster
coolmind259 is offline Offline
34 posts
since Apr 2009
Sep 26th, 2009
-1

Re: Site is taking a long long time to load.

Have you tried renaming htaccess to something else and then testing the page? I notice you're not in any rush for this!
Sponsor
Featured Poster
Reputation Points: 1046
Solved Threads: 942
Sarcastic Poster
ardav is offline Offline
6,661 posts
since Oct 2006
Sep 26th, 2009
0

Re: Site is taking a long long time to load.

Hi Ardav,

Thank you for your help. I have tried renaming .htacess file to htaccess and I think the site is loading quick now. Actually my .htaccess file was hidden on my server.

I have just renamed .htaccess file to htaccess then upload on my server, any suggestion?

Thank you
Take care,
Coolnmind
Reputation Points: 10
Solved Threads: 0
Light Poster
coolmind259 is offline Offline
34 posts
since Apr 2009
Sep 26th, 2009
-1

Re: Site is taking a long long time to load.

Your .htaccess file may still be there if you've just uploaded another file called htaccess. I was thinking of renaming it to, say, htaccess.txt in situ, i.e. on the server in your FTP view. I don't know enough about htaccess to be able to advise you, but it seems like the obvious culprit if you've got nothing else in your files that could account for the slow loads. Have you contacted your host to ask them for advice? It could be that you're on a shared host with some naughty people who are serving mp3s and videos and slowing everybody down.
Sponsor
Featured Poster
Reputation Points: 1046
Solved Threads: 942
Sarcastic Poster
ardav is offline Offline
6,661 posts
since Oct 2006
Sep 26th, 2009
0

Re: Site is taking a long long time to load.

Reputation Points: 562
Solved Threads: 367
Posting Maven
almostbob is offline Offline
2,970 posts
since Jan 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Modify search with text box
Next Thread in PHP Forum Timeline: $_POST vs. $_GET





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC