Jump to content

My PHP site takes 10 secs to load the first page


guarriman

Recommended Posts

Hi.

 

Working with PHP5, I'm suffering an odd issue with the load of my website, which is an application allowing users to register and to post question in a kind of forum/bboard.

 

It's made with some PHP classes I created (they write/read to/from mySQL tables), and uses Smarty.

 

But the first time one user access any webpage, it takes 5-10 seconds to load. Then the rest of pages visited by the same user go really fast, so I'm wondering what's wrong with my PHP app.

 

Do you have similar experiences? I'm considering:

 

- Smarty takes some seconds to compile

- App takes some second to handle session variables (I use a lot of them)

 

Any suggestion is welcome. Thank you very much,

--mark

Put some timers around your SQL queries and find out how long they're taking...

Put a timer around your whole script.

 

Check your SQL slow query log.

Give us the table layouts, and indexes (<- biggest problem with DB queries is lack of indexes)

A request for any one web page should only cause the code and data necessary for that one web page to be parsed/executed/loaded/or created. If you have somehow done this so that all code is loaded and parsed when any page is requested, rethink what you have done.

 

The only way anyone in a forum can specifically help you is if you provide specific details. So far the information you have provided is fairly vague and won't get you anything but guesses as to what the problem is.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.