Home Accessibility Courses Twitter The Mouth Facebook Resources Site Map About Us Contact
 
For 2023 (and 2024 ...) - we are now fully retired from IT training.
We have made many, many friends over 25 years of teaching about Python, Tcl, Perl, PHP, Lua, Java, C and C++ - and MySQL, Linux and Solaris/SunOS too. Our training notes are now very much out of date, but due to upward compatability most of our examples remain operational and even relevant ad you are welcome to make us if them "as seen" and at your own risk.

Lisa and I (Graham) now live in what was our training centre in Melksham - happy to meet with former delegates here - but do check ahead before coming round. We are far from inactive - rather, enjoying the times that we are retired but still healthy enough in mind and body to be active!

I am also active in many other area and still look after a lot of web sites - you can find an index ((here))
Checking server performance for PHP generated pages

I had a couple of reports recently about web pages from our site being a little slow to load, and my independent spy tells me that they're not bad, but not the world's fastest either. And a little thought lead me to conclude that could be because of the various PHP scripting elements included at the front of each page.

How should I investigate this? I have added in a whole array of microtime(); captures at strategic points in the included code ... like
$timer[14] = microtime();
and I have added a labelling array too:
$tabo[14] = "Starting top of page preps";

And I have added an extra page in which uses the included code, producing an elapsed time analysis - loop code like

foreach (array_keys($timer) as $subs) {
list($ins,$outs) = explode(" ",$timer[$subs]);
# Normalise to second to retain accuracy
if ($oldout == 0) $oldout = $outs;
$elt = ($outs-$oldout) + $ins;
# Format time difference
$newelt = sprintf("%.4f",$elt - $oldelt);
$oldelt = $elt;
print "$elt<br>";
}


Suddenly ... from a black hole which holds the server response for around a second, a series of timings is revealed which gives the "game" away as to where it's worth looking at the efficiency. You can see how my test page runs here and compare it one I did during testing that started like this:

0 0.34967100 1212773196 .
1 0.34970500 1212773196 (0.0000) initialised page script.
2 0.35110600 1212773196 (0.0014) processed whcstd.
3 0.35263500 1212773196 (0.0015) processed webhelpers2.
4 0.23460400 1212773198 (1.8820) processed login.
5 0.23563200 1212773198 (0.0010) processed hotel.
6 0.23650700 1212773198 (0.0009) processed booking.
7 0.23667900 1212773198 (0.0002) recovered booking session.
8 0.23894900 1212773198 (0.0023) set up courses and calendars.
9 0.23900200 1212773198 (0.0001) 4 layer - preprocessor for special cases.
10 0.23907100 1212773198 (0.0001) 4 layer - finish previous page.
11 0.23945500 1212773198 (0.0004) 4 layer - prepare next page.
12 0.24002300 1212773198 (0.0006) 4 layer - Fill in page variables into template.
14 0.24747000 1212773198 (0.0074) Starting top of page preps.
15 0.24776500 1212773198 (0.0003) Connected to database and handled 'navigation on'.
16 0.59276600 1212773198 (0.3450) DDA preference, country, languages handled.
17 0.59296500 1212773198 (0.0002) Identifying browser string.
18 0.41007200 1212773200 (1.8171) Throttling back systems doing a denial of service.
19 0.41257100 1212773200 (0.0025) Recent history database tidied.
20 0.10485400 1212773201 (0.6923) 'See Also' links evaluated.
21 0.21190500 1212773201 (0.1071) User Comments handled.
22 0.21242300 1212773201 (0.0005) Course Price table loaded.
23 0.21324600 1212773201 (0.0008) User's language preference logged.
24 0.21483800 1212773201 (0.0016) Country identified and output tailored.
25 0.21498100 1212773201 (0.0001) Side image and world zone set.
26 0.21500600 1212773201 (0.0000) Top image and data mine set up for Google arrivals.
27 0.21505800 1212773201 (0.0001) Back links calculated.
28 0.21510800 1212773201 (0.0000) Amazon referrals handled.
29 0.21544600 1212773201 (0.0003) Changes to user preferences saved.
(written 2008-06-06, updated 2008-06-07)

 
Associated topics are indexed as below, or enter http://melksh.am/nnnn for individual articles
H312 - PHP - Tips and Techniques
  [789] Hot answers in PHP - (2006-07-02)
  [917] Syntax checking in PHP - (2006-11-07)
  [1010] Dates, times, clickable diarys in PHP - (2006-12-28)
  [1270] PHP Standalone - keyboard to screen - (2007-07-18)
  [1649] Easy conversion - image formats, currencies and distances - (2008-05-21)
  [1684] Two PHP include files to make easy web site indexing and navigation - (2008-06-21)
  [1958] PHP - Parse error: syntax error, unexpected $end ... - (2008-12-23)
  [1983] Keeping PHP code in database and running it - (2009-01-09)
  [2025] Injection Attack if register_globals in on - PHP - (2009-02-04)
  [2274] PHP preg functions - examples and comparision - (2009-07-08)
  [2478] How did I do THAT? - (2009-10-26)
  [2981] How to set up short and meaningfull alternative URLs - (2010-10-02)
  [4074] A comment on comments in PHP - (2013-04-28)
  [4310] Problem ... I want to print a series of numbered forms - (2014-10-05)
  [4319] PHP - some quick fixes if scripts have issues, and how to use our support - (2014-11-19)
  [4426] FileMaker Day to Unix Time conversion - (2015-02-15)
  [4621] The power of scripting - (2016-01-12)

H114 - Sourcing, installing and configuring PHP
  [192] Current MySQL and PHP paths and upgrades - (2005-01-28)
  [316] Development Environments - (2005-05-19)
  [481] PHP upgrade - traps to watch - (2005-10-31)
  [934] Clustering, load balancing, mod_rewrite and mod_proxy - (2006-11-21)
  [1688] cannot restore segment prot after reloc message - PHP / httpd - (2008-06-26)
  [1731] Apache httpd, MySQL, PHP - installation procedure - (2008-08-01)
  [1768] What is built in to this httpd and PHP? - (2008-08-23)
  [1936] Quick Summary - PHP installation - (2008-12-12)
  [2317] How to make a Risotto (PHP build style) - (2009-08-02)
  [2433] Controlling, supressing, enabling PHP error messages - (2009-10-02)
  [2589] Your PHP code does not work? Here is where to start looking. - (2010-01-18)
  [2646] Compile but do not run PHP - syntax check only - (2010-02-22)
  [3132] Virtual Hosting with Apache http server - an overall scheme, and avoiding common pitfalls - (2011-01-14)
  [3635] Parse error: parse error, unexpected T_STRING on brand new web site - why? - (2012-03-03)
  [3955] Building up from a small PHP setup to an enterprise one - (2012-12-16)
  [4437] Adding a PHP build option, rotating an image based on camera data, and a new look at thumbnails in PHP - (2015-02-22)


Back to
Slow boot and terminal start on Linux boxes
Previous and next
or
Horse's mouth home
Forward to
Talk on TransWilts train service to Green Party
Some other Articles
Compiling C programs with gcc - an overview
Dynamic Memory Allocation in C
What are Unions (C programming)
Talk on TransWilts train service to Green Party
Checking server performance for PHP generated pages
Slow boot and terminal start on Linux boxes
Factory method example - Perl
Example of OO in Perl
Python in an afternoon - a lecture for experienced programmers
Westonbirt Arboretum Postcode
4759 posts, page by page
Link to page ... 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96 at 50 posts per page


This is a page archived from The Horse's Mouth at http://www.wellho.net/horse/ - the diary and writings of Graham Ellis. Every attempt was made to provide current information at the time the page was written, but things do move forward in our business - new software releases, price changes, new techniques. Please check back via our main site for current courses, prices, versions, etc - any mention of a price in "The Horse's Mouth" cannot be taken as an offer to supply at that price.

Link to Ezine home page (for reading).
Link to Blogging home page (to add comments).

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2024: 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho

PAGE: http://www.wellho.net/mouth/1667_Che ... pages.html • PAGE BUILT: Sun Oct 11 16:07:41 2020 • BUILD SYSTEM: JelliaJamb