[Phpwm] PHP Website load times in Firefox

Dave Holmes dave at neteffekt.co.uk
Fri Oct 2 11:40:31 UTC 2009


Have you got the HostNameLookup directive enabled in apache as it could
be a DNS issue you are experiencing and nothing to do with PHP or your code


Mike Tipping wrote:
> OK more pieces of the puzzle.
>
> The total page size is 9.2K
>
> There is an required script at the top of each page that includes all the
> classes, contains DB connection parameters and calls the mysql_connect and
> mysql_select_db.
>
> The index.php page requires this, checks for a user object in the session
> and if it isn't there bounces to the login page. If I DIE before the page is
> bounced the page takes a fraction of a second to load.
>
> On the login page if I die after the require script is loaded it takes 2
> minutes to load. 
>
> So it must be something in the requires script, but that script was already
> required by the index page so surly it would have hung there too...
>
> The required script includes the call to mysql_connect and mysql_select_db,
> if I comment mysql_select_db out the page loads in seconds.
>
> So there's my culprit, mysql_select_db is the problem.
>
> BUT I ran the same test on a different computer in a different office and
> with the original page that took 2 minutes on my computer, it took 806ms on
> that computer. 
>
> AND it always takes exactly 2 minutes (OK 1 minute 60 seconds according to
> net) on my computer. It looks like the MYSQL server has taken a dislike to
> my IP address and is purposely delaying the connection?
>
> Any ideas or advice.
>
> Cheers
>
> Mike
>
>
>
>
> On 2/10/09 11:30, "Alex Mace" <alex at hollytree.co.uk> wrote:
>
>   
>> It could be database related, but without any figures to go on I think
>> we're all just guessing. You need to use something like the Net tab in
>> Firebug or YSlow or Google Page Speed or seige etc, etc, so you can
>> actually get some raw figures to test your changes against so you can
>> identify the source of the problem. Otherwise you're just groping
>> around in the dark.
>>
>> Alex
>>
>> On 2 Oct 2009, at 11:04, Mike Tipping wrote:
>>
>>     
>>> The page that is loading is very minimal, generally just a logo and
>>> login
>>> form. It does include Mootools and my own small JS library but those
>>> should
>>> be cached after the first load. So I don't think it's an issue with
>>> downloading resources.
>>>
>>> I did wonder if it might be connecting to the DB as the top of the
>>> page
>>> includes the mysql_connect and mysql_select_db, but if that was slow
>>> it
>>> would be slow for everyone as the server would be holding things up.
>>>
>>> Cheers
>>>
>>> Mike
>>>
>>>
>>> On 2/10/09 10:37, "Dave Holmes" <dave at neteffekt.co.uk> wrote:
>>>
>>>       
>>>> Mike,
>>>>
>>>> My guess would be JavaScript especially in complex web
>>>> applications, the
>>>> browser sequentially downloads the files to avoid problems with
>>>> dependencies where as all of the other content is downloaded via
>>>> multiple connections. If you look at the net tab in firebug you
>>>> will see
>>>> this behaviour.
>>>>
>>>> Minimise the number of files and apply JS compression this will
>>>> result
>>>> in dramatic improvements.
>>>>
>>>> Browser caching of the JS will mean this only occurs on first load of
>>>> your site.
>>>>
>>>> Dave
>>>>
>>>>
>>>>
>>>> Mike Tipping wrote:
>>>>         
>>>>> Several of the sites I've built and manage seem to take an age to
>>>>> initially
>>>>> load. These sites seem to be those that require a login so the
>>>>> delay is the
>>>>> initial login screen which should just be checking to see if there
>>>>> is a user
>>>>> in the session and displaying the login screen. Sometimes they
>>>>> load OK but
>>>>> often enough to be annoying they take an age.
>>>>>
>>>>> I was thinking this could be a delay on the server side but if
>>>>> while I'm
>>>>> waiting for the site to load, I open the same site is Safari on
>>>>> the same
>>>>> computer it often loads straight away.
>>>>>
>>>>> I haven't had any clients complain about slow load times but I
>>>>> have a
>>>>> colleague who uses Safari most of the time and does get slow load
>>>>> times.
>>>>>
>>>>> Does anyone know of any issues with Firefox and checking session
>>>>> variables
>>>>> or tools that would tell me what the browsers is doing while I'm
>>>>> staring as
>>>>> a blank screen.
>>>>>
>>>>> Cheers
>>>>>
>>>>> Mike
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Phpwm mailing list
>>>>> Website : http://www.phpwm.org
>>>>> Twitter : http://www.twitter.com/phpwm
>>>>> Facebook: http://www.facebook.com/group.php?gid=2361609907
>>>>>
>>>>> Post to list: Phpwm at mailman.lug.org.uk
>>>>> Archive etc : https://mailman.lug.org.uk/mailman/listinfo/phpwm
>>>>>
>>>>>
>>>>>           
>>>> _______________________________________________
>>>> Phpwm mailing list
>>>> Website : http://www.phpwm.org
>>>> Twitter : http://www.twitter.com/phpwm
>>>> Facebook: http://www.facebook.com/group.php?gid=2361609907
>>>>
>>>> Post to list: Phpwm at mailman.lug.org.uk
>>>> Archive etc : https://mailman.lug.org.uk/mailman/listinfo/phpwm
>>>>         
>>>
>>> _______________________________________________
>>> Phpwm mailing list
>>> Website : http://www.phpwm.org
>>> Twitter : http://www.twitter.com/phpwm
>>> Facebook: http://www.facebook.com/group.php?gid=2361609907
>>>
>>> Post to list: Phpwm at mailman.lug.org.uk
>>> Archive etc : https://mailman.lug.org.uk/mailman/listinfo/phpwm
>>>       
>> _______________________________________________
>> Phpwm mailing list
>> Website : http://www.phpwm.org
>> Twitter : http://www.twitter.com/phpwm
>> Facebook: http://www.facebook.com/group.php?gid=2361609907
>>
>> Post to list: Phpwm at mailman.lug.org.uk
>> Archive etc : https://mailman.lug.org.uk/mailman/listinfo/phpwm
>>     
>
>
>
> _______________________________________________
> Phpwm mailing list
> Website : http://www.phpwm.org
> Twitter : http://www.twitter.com/phpwm
> Facebook: http://www.facebook.com/group.php?gid=2361609907
>
> Post to list: Phpwm at mailman.lug.org.uk
> Archive etc : https://mailman.lug.org.uk/mailman/listinfo/phpwm
>
>   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.lug.org.uk/pipermail/phpwm/attachments/20091002/eb2af450/attachment-0001.htm 


More information about the Phpwm mailing list