I want to test how long a php/mysql generated page takes to load so I can try different configurations and optimize my code.
For instance, I'd like to load it 100 times and get average load times. I'd like to simulate the conditions of a popular browser - IE or Firefox.
Is there any software or script that would help me do this?
I figure I'd want to make sure I'm loading the page, and that I'm NOT using the cache. Also I'd like to be able to automate it (hitting reload 100 times is painful).
Speed Testing - How Do I Load the Page 100 Times?
Moderator: General Moderators
here's a simple timing class for you to use: viewtopic.php?t=56775
Also, i don't know about reloading the page 100 times =/ maybe just sections of it to find out where bottlenecks are?
I suppose at the very bottom of the page you could do...
or stick a meta refresh tag in there.
Maybe update a session variable to keep track of pageload times
Also, i don't know about reloading the page 100 times =/ maybe just sections of it to find out where bottlenecks are?
I suppose at the very bottom of the page you could do...
Code: Select all
sleep(1);
header('Location: thispage.php');
exit;Maybe update a session variable to keep track of pageload times
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
I was actually more interested in total load time, eg not just the php execution time. Though php execution time is one place to start.
Thus I might be looking for some kind of firefox extension or load-tester, that isn't php specific. I figured php developers might know about this though.
I want to load it 100 times to reduce standard deviation. When I load something once, the time is highly variable (sometimes by a factor of 10).
Caching - what is the best way to get rid of this? I read that the nocache html tag might not be cross-browser compatible. I'd like to try it in at least IE 7 and Firefox 1.5.
...
The Load Time Analyzer for Firefox is looking pretty good, for one-time use.
https://addons.mozilla.org/firefox/3371/
Thus I might be looking for some kind of firefox extension or load-tester, that isn't php specific. I figured php developers might know about this though.
I want to load it 100 times to reduce standard deviation. When I load something once, the time is highly variable (sometimes by a factor of 10).
Caching - what is the best way to get rid of this? I read that the nocache html tag might not be cross-browser compatible. I'd like to try it in at least IE 7 and Firefox 1.5.
...
The Load Time Analyzer for Firefox is looking pretty good, for one-time use.
https://addons.mozilla.org/firefox/3371/
-
alex.barylski
- DevNet Evangelist
- Posts: 6267
- Joined: Tue Dec 21, 2004 5:00 pm
- Location: Winnipeg
Write a simple javascript to reload after onload has fired??? Make sure to pull from server not from cache...
I think the above is how you do that...if not google reload/replace functions and figure it out. Have the javascript refresh an IFRAME or something similar (using frames)???
Cheers
Code: Select all
reload(true)Cheers
- AKA Panama Jack
- Forum Regular
- Posts: 878
- Joined: Mon Nov 14, 2005 4:21 pm
Actually I use the Microsoft Web Application Stress Test Tool...
Download the Web Application Stress Tool from here
http://www.microsoft.com/downloads/deta ... laylang=en
It will simulate many clients accessing your web site so you can find out how many connections per second a web page can handle. I wouldn't run this on a shared host site because you might get a shutdown warning from overloading the CPU.
It can send thousands of requests per second to find the upper limit.
I have another box on my home network where I install sites for web stress testing. This gives me no latency for an accurate test.
This is how I came up with the benchmark numbers for my ADOdb Lite database layer.
http://adodblite.sourceforge.net/benchmark.php
Download the Web Application Stress Tool from here
http://www.microsoft.com/downloads/deta ... laylang=en
It will simulate many clients accessing your web site so you can find out how many connections per second a web page can handle. I wouldn't run this on a shared host site because you might get a shutdown warning from overloading the CPU.
I have another box on my home network where I install sites for web stress testing. This gives me no latency for an accurate test.
This is how I came up with the benchmark numbers for my ADOdb Lite database layer.
http://adodblite.sourceforge.net/benchmark.php
-
nickvd
- DevNet Resident
- Posts: 1027
- Joined: Thu Mar 10, 2005 5:27 pm
- Location: Southern Ontario
- Contact:
If you have access to a linux box, there's the 'ab' util...
Designed for testing apache itself, but it should work just fine for php scripts...'nickvd@exile:~$ man ab' wrote:SUMMARY
ab is a tool for benchmarking your Apache Hypertext Transfer Protocol
(HTTP) server. It is designed to give you an impression of how your
current Apache installation performs. This especially shows you how
many requests per second your Apache installation is capable of serv‐
ing.
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US