Brent
|
| Posted: 06/28/2002, 1:44 PM |
|
There is a way to determine how fast your web pages are loading. First of all you
can't use a stop watch because this doesn't tell you what is happening on the
web server, only what's happening on the client (browser).
You need to record the amount of time it takes for the server to render a page.
Here's how it can be done (in PHP) and CCS. It should also work in CC. Someone
familiar with ASP can generate similar code and publish it on this thread.
1) In your "Page: Header, Before Show: Custom Code" add the lines of code:
global $page_start;
$page_start = microtime();
This will record the time the header is generated.
2) In your "Page: Footer, Before Show: Custom Code" add the lines of code:
global $page_start;
$page_end = MicroTime();
list($usec_start, $sec_start) = explode(" ",$page_start);
list($usec_end, $sec_end) = explode(" ",MicroTime());
$elapsed = ((float)$usec_end+(float)$sec_end) - ((float)$usec_start+(float)$sec_start);
Echo "Page load time: ".number_format($elapsed,3);
It will display the time between generating the page header and the page footer.
Since this code is in your Header and Footer, it should work for all pages.
I'd like some volunteers to try this code. For those of you running a
debugger, you must disable the debugger in PHP.INI by commenting out the line
;debugger.enabled=true
with a ";" like I did here. Otherwise your pages will load too slowly.
Use the pre-built Employee application and the emps_list grid just so we
are standardizing on the same application and form. It doesn't have too much
data in it so the results won't be skewed by the database engine.
I'd like to know the following facts (sample data provided):
Web Server Processor Speed: 500Mhz
# of Processors: 1
Dev. System: CCS or CC
Language: PHP or ASP
Persistent Connection: Yes / No
Database: Access / MySQL etc.
Application: Employee
CCS Form Name: emps_list
Search: None
Time: x seconds
Webserver & Browser on same machine: Yes/No
Reload the page a couple of times until the time settles down.
This will give us a rough idea of the performance of rendering pages. I want
to put it into a spreadsheet or database to see how processor or language
affects the speed of the web server.
CC users can try the same thing. Post your results back to this thread so
we can compare notes. I guess that's it. If I missed anything, let me know.
|
|
|
 |
Ken Hardwick
|
| Posted: 06/28/2002, 3:55 PM |
|
Here is a link to a javascript that you might want to test out also...
This popup message box tells you how long the page took to load in your browser. Useful when you want to test a page with a lot of contents.
http://www.simplythebest.net/scripts/javascript_95.html
|
|
|
 |
Brent
|
| Posted: 06/29/2002, 2:35 PM |
|
Ken the Javascript looks interesting, but of course runs on the client side whic
also takes into account the bandwidth. It purpose is to time the delay the user
sees, which is important, but not what I was looking for.
I really wanted to know how hard is the webserver working. For example, does
the web server render a page in 0.5 seconds or 0.05 seconds?
For the sake of argument, if it takes the web server 0.5 seconds to render a
page (the time between creating the header and footer), does that mean it can
only handle 2 pages per second?
|
|
|
 |
Sanddy
|
| Posted: 06/30/2002, 2:41 AM |
|
Brent,
I guess there are profilers available that help you do this kind of analysis. I am not sure about other languages, but at least for ASP.NET, you have the QATime Profiler...
Basically, the total time for the page to be created on the server, includes the time taken for the Web Server engine to dish out the page plus the time taken for the database to return the data.
These kind of analysis are generally conducted to improve the performance of the application as the whole ... hence its equally important to note the time taken by the database server also... hence just plain timing of code will not give you much idea on whats the actual problem with your application so that you can understand the problem and take corrective actions ...
just a thought ....
Sanddy
|
|
|
 |
Brent
|
| Posted: 06/30/2002, 9:08 AM |
|
Sanddy,
>>I guess there are profilers available that help you do this kind of analysis.
Actually I have profiled the executed PHP code by file, by function, and by line of code,
sorted it, and graphed it. I was trying to determine why CCS pages take longer
to display than CC. And I think I know why.
But the code I submitted at the beginning of this thread is rather neat because
you can run it on your live website. Hide it in the footer (or require admin access
before you display it) and you'll know how fast your server is performing. It is
sort of like taking the heartbeat of the webserver.
I guess the reason I started this thread is to try and determine how many
pages per second the webserver will produce (grid forms). I wanted to know if other
users were getting the same performance that I was. I need to know this now rather
than wait until the last minute and discover I can only produce 10 pages per second.
This will limit the # of concurrent users I can per webserver and the # of webservers
I need to use.
Brent
|
|
|
 |
Matthew Kreh
|
| Posted: 07/04/2002, 11:31 PM |
|
Brent,
On my development station, the Portal example takes .25 seconds to execute. If you have ASP 3.0 available on your server (mainly for Server.Execute) like I do in Windows 2000 Server, you can cut the execution time down to .01 seconds using some custom code that I am working on. If you can code in ASP we can correspond about this to enhance your site's performance.
NOTE : The ASP code I am working on is not for beginning ASP coders, but for experienced coders only.
Matthew_Kreh@hotmail.com
|
|
|
 |
|